pub struct AudioPacketFormat { /* private fields */ }Expand description
The codec, protection and decoded dimensions of one compressed audio frame.
Quantities are in 1..=i32::MAX, the range of the SDK’s signed fields.
Codec delivery rules are checked when a frame is admitted for sending,
preserving lossless inspection of received packets.
Implementations§
Source§impl AudioPacketFormat
impl AudioPacketFormat
Sourcepub fn new(
codec: AudioCodec,
sample_rate: u32,
num_channels: u32,
num_samples: u32,
) -> Result<Self>
pub fn new( codec: AudioCodec, sample_rate: u32, num_channels: u32, num_samples: u32, ) -> Result<Self>
Describe a compressed audio frame of codec with the given quantities.
§Errors
Error::InvalidInput unless each quantity is in 1..=i32::MAX.
Sourcepub fn with_protected(self, protected: bool) -> Self
pub fn with_protected(self, protected: bool) -> Self
The same format with the requested stream protection.
Sourcepub fn codec(self) -> AudioCodec
pub fn codec(self) -> AudioCodec
The compressed audio codec.
Sourcepub fn is_protected(self) -> bool
pub fn is_protected(self) -> bool
Whether the stream is protected.
Sourcepub fn sample_rate(self) -> u32
pub fn sample_rate(self) -> u32
Sample rate in hertz.
Sourcepub fn num_channels(self) -> u32
pub fn num_channels(self) -> u32
Number of channels.
Sourcepub fn num_samples(self) -> u32
pub fn num_samples(self) -> u32
Samples per channel the frame decodes to.
Trait Implementations§
Source§impl Clone for AudioPacketFormat
impl Clone for AudioPacketFormat
impl Copy for AudioPacketFormat
Source§impl Debug for AudioPacketFormat
impl Debug for AudioPacketFormat
impl Eq for AudioPacketFormat
Source§impl Hash for AudioPacketFormat
impl Hash for AudioPacketFormat
impl PacketFormat for AudioPacketFormat
Source§impl PartialEq for AudioPacketFormat
impl PartialEq for AudioPacketFormat
impl StructuralPartialEq for AudioPacketFormat
Auto Trait Implementations§
impl Freeze for AudioPacketFormat
impl RefUnwindSafe for AudioPacketFormat
impl Send for AudioPacketFormat
impl Sync for AudioPacketFormat
impl Unpin for AudioPacketFormat
impl UnsafeUnpin for AudioPacketFormat
impl UnwindSafe for AudioPacketFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more