pub fn create_decoder(
codec: &str,
extra_data: Option<&[u8]>,
sample_rate: u32,
channels: u8,
) -> Result<Box<dyn AudioDecoder>, AudioError>Expand description
Construct an audio decoder for the given codec name.
codec is matched case-insensitively. Supported tokens:
mp3/mpegvorbis(raw audio packet form — caller is responsible for feeding the three Xiph setup packets first via theextra_dataparameter on first construction, then the audio packets viadecode)
extra_data, sample_rate, and channels come from the demux
side’s container metadata. For codecs that carry full setup in the
stream (MP3) extra_data may be None.