pub enum CodecType {
Pcmu,
Pcma,
Opus,
}Expand description
Supported audio codec types.
Variants§
Pcmu
G.711 μ-law (PCMU) - RTP payload type 0
Pcma
G.711 A-law (PCMA) - RTP payload type 8
Opus
Opus - RTP payload type 111 (dynamic)
Implementations§
Source§impl CodecType
impl CodecType
Sourcepub fn payload_type(&self) -> u8
pub fn payload_type(&self) -> u8
Get the RTP payload type number for this codec.
Sourcepub fn clock_rate(&self) -> u32
pub fn clock_rate(&self) -> u32
Get the clock rate (samples per second) for this codec.
Sourcepub fn frame_duration_ms(&self) -> u32
pub fn frame_duration_ms(&self) -> u32
Get the frame duration in milliseconds.
Sourcepub fn samples_per_frame(&self) -> usize
pub fn samples_per_frame(&self) -> usize
Get the number of samples per frame.
Sourcepub fn from_payload_type(pt: u8) -> Option<Self>
pub fn from_payload_type(pt: u8) -> Option<Self>
Parse a codec type from an RTP payload type number.
Trait Implementations§
impl Copy for CodecType
impl Eq for CodecType
impl StructuralPartialEq for CodecType
Auto Trait Implementations§
impl Freeze for CodecType
impl RefUnwindSafe for CodecType
impl Send for CodecType
impl Sync for CodecType
impl Unpin for CodecType
impl UnsafeUnpin for CodecType
impl UnwindSafe for CodecType
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