pub struct Mp3Decoder { /* private fields */ }Expand description
Stream-level MP3 decoder: push raw bytes (packets may
split/join frames — the decoder frame-syncs internally, skipping ID3 and
garbage), then drain decoded PCM with next_frame.
Implementations§
Source§impl Mp3Decoder
impl Mp3Decoder
pub fn new() -> Self
Sourcepub fn push(&mut self, bytes: &[u8])
pub fn push(&mut self, bytes: &[u8])
Feed more compressed bytes; any whole frames they complete are decoded
and queued for next_frame.
Sourcepub fn next_frame(&mut self) -> Result<DecodedAudio>
pub fn next_frame(&mut self) -> Result<DecodedAudio>
Pull the next decoded frame. Err(Again) = feed more input;
Err(Eof) = flushed and fully drained.
§Errors
Error::Again when more input is needed; Error::Eof once
flush was called and every frame has been drained.
Sourcepub fn flush(&mut self)
pub fn flush(&mut self)
Signal end of input: once the queue drains, next_frame
returns Err(Eof) instead of Err(Again).
Trait Implementations§
Source§impl Default for Mp3Decoder
impl Default for Mp3Decoder
Source§impl Drop for Mp3Decoder
MP3_CENSUS=1: print the kernel-reach census when a decoder is dropped, so the
SHIPPING binary (the rff CLI, any embedding application) can prove which
kernel arms its decode actually took – not only this crate’s examples.
impl Drop for Mp3Decoder
MP3_CENSUS=1: print the kernel-reach census when a decoder is dropped, so the
SHIPPING binary (the rff CLI, any embedding application) can prove which
kernel arms its decode actually took – not only this crate’s examples.