opus_decoder_create method
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.
Implementation
ffi.Pointer<OpusDecoder> opus_decoder_create(
int Fs,
int channels,
ffi.Pointer<ffi.Int32> error,
) {
return _opus_decoder_create(Fs, channels, error);
}