pub struct Decoder { /* private fields */ }Expand description
A WMA v2 decoder for one stream. Give it the packets in order with
decode_packet, then call flush once at the end.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn new(p: &Params) -> Result<Self>
pub fn new(p: &Params) -> Result<Self>
A decoder for a stream with these parameters. It fails when the format tag is not WMA v2 or the parameters are not supported.
Sourcepub fn sample_rate(&self) -> u32
pub fn sample_rate(&self) -> u32
The sample rate, in samples per second.
Sourcepub fn delay(&self) -> usize
pub fn delay(&self) -> usize
Codec delay in samples per channel: the first two frames only prime the overlap and are not output.
Sourcepub fn decode_packet(&mut self, packet: &[u8], out: &mut Vec<f32>) -> Result<()>
pub fn decode_packet(&mut self, packet: &[u8], out: &mut Vec<f32>) -> Result<()>
Decode one packet (block_align bytes), appending interleaved samples in [-1, 1) to
out. On error nothing is appended and the bit reservoir is dropped, so the next packet
starts cleanly.
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnsafeUnpin for Decoder
impl UnwindSafe for Decoder
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