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() -> Mp3Decoder
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.
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§fn default() -> Mp3Decoder
fn default() -> Mp3Decoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Mp3Decoder
impl RefUnwindSafe for Mp3Decoder
impl Send for Mp3Decoder
impl Sync for Mp3Decoder
impl Unpin for Mp3Decoder
impl UnsafeUnpin for Mp3Decoder
impl UnwindSafe for Mp3Decoder
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