[][src]Function opus_sys2::opus_decoder_create

pub unsafe extern "C" fn opus_decoder_create(
    Fs: opus_int32,
    channels: c_int,
    error: *mut c_int
) -> *mut OpusDecoder

Allocates and initializes a decoder state. @param [in] Fs opus_int32: Sample rate to decode at (Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param [in] channels int: Number of channels (1 or 2) to decode @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes

Internally Opus stores data at 48000 Hz, so that should be the default value for Fs. However, the decoder can efficiently decode to buffers at 8, 12, 16, and 24 kHz so if for some reason the caller cannot use data at the full sample rate, or knows the compressed data doesn't use the full frequency range, it can request decoding at a reduced rate. Likewise, the decoder is capable of filling in either mono or interleaved stereo pcm buffers, at the caller's request.