opus_multistream_encode method
- Pointer<
OpusMSEncoder> st, - Pointer<
Int16> pcm, - int frame_size,
- Pointer<
Uint8> data, - int max_data_bytes,
Encodes a multistream Opus frame.
@param st OpusMSEncoder*: Multistream encoder state.
@paramin
pcm const opus_int16*: The input signal as interleaved
samples.
This must contain
frame_sizechannels
samples.
@param frame_size int: Number of samples per channel in the input
signal.
This must be an Opus frame size for the
encoder's sampling rate.
For example, at 48 kHz the permitted values
are 120, 240, 480, 960, 1920, and 2880.
Passing in a duration of less than 10 ms
(480 samples at 48 kHz) will prevent the
encoder from using the LPC or hybrid modes.
@paramout
data unsigned char: Output payload.
This must contain storage for at
least a max_data_bytes.
@param in
max_data_bytes opus_int32: Size of the allocated
memory for the output
payload. This may be
used to impose an upper limit on
the instant bitrate, but should
not be used as the only bitrate
control. Use #OPUS_SET_BITRATE to
control the bitrate.
@returns The length of the encoded packet (in bytes) on success or a
negative error code (see @ref opus_errorcodes) on failure.
Implementation
int opus_multistream_encode(
ffi.Pointer<OpusMSEncoder> st,
ffi.Pointer<ffi.Int16> pcm,
int frame_size,
ffi.Pointer<ffi.Uint8> data,
int max_data_bytes,
) {
return _opus_multistream_encode(st, pcm, frame_size, data, max_data_bytes);
}