Skip to main content

Decoder

Trait Decoder 

Source
pub trait Decoder: Send {
    // Required methods
    fn set_header(&mut self, header: &CodecHeader) -> Result<SampleFormat>;
    fn decode(&mut self, data: &mut Vec<u8>) -> Result<bool>;

    // Provided method
    fn output_encoding(&self) -> SampleEncoding { ... }
}
Expand description

Audio decoder trait — matches the C++ Decoder interface.

Required Methods§

Source

fn set_header(&mut self, header: &CodecHeader) -> Result<SampleFormat>

Initialize the decoder from a codec header. Returns the sample format.

Source

fn decode(&mut self, data: &mut Vec<u8>) -> Result<bool>

Decode audio data in-place. Returns true if successful. For PCM this is a no-op (passthrough).

Provided Methods§

Source

fn output_encoding(&self) -> SampleEncoding

Encoding produced by decode.

Implementors§