Skip to main content

AudioDecoder

Trait AudioDecoder 

Source
pub trait AudioDecoder: Send {
    // Required methods
    fn decode(&mut self, encoded: &[u8], output: &mut Vec<i16>);
    fn codec_type(&self) -> CodecType;
}
Expand description

Trait for audio decoders.

Implementations decode compressed audio to PCM (signed 16-bit samples).

Required Methods§

Source

fn decode(&mut self, encoded: &[u8], output: &mut Vec<i16>)

Decode encoded data to PCM samples.

§Arguments
  • encoded - Input encoded data
  • output - Output buffer for PCM samples (appended to)
Source

fn codec_type(&self) -> CodecType

Get the codec type.

Implementors§