pub struct Config {
pub sample_rate: u32,
pub channel_count: u32,
}Expand description
Typed MP3 configuration parsed from an MPEG audio frame header.
Fields§
§sample_rate: u32Sampling frequency in Hz.
channel_count: u32Channel count (1 for the mono channel mode, 2 otherwise).
Implementations§
Source§impl Config
impl Config
Sourcepub fn parse(data: &[u8]) -> Result<Self>
pub fn parse(data: &[u8]) -> Result<Self>
Parse the catalog config from the start of an MPEG Layer III frame.
Reads the 4-byte frame header (ISO/IEC 11172-3 §2.4.1.2): verifies the frame sync and that the layer is III, then derives the sample rate from the version + sample-rate index and the channel count from the channel mode. The buffer is not advanced; the frame is published whole.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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