pub unsafe extern "C" fn opus_encode_float(
st: *mut OpusEncoder,
pcm: *const f32,
frame_size: c_int,
data: *mut c_uchar,
max_data_bytes: opus_int32,
) -> opus_int32Expand description
Encodes an Opus frame from floating point input.
§Arguments
st[in] - OpusEncoder*: Encoder statepcm[in] - float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. Samples with a range beyond +/-1.0 are supported but will be clipped by decoders using the integer API and should only be used if it is known that the far end supports extended dynamic range. length is frame_sizechannelssizeof(float)frame_size[in] - 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.data[out] - unsigned char*: Output payload. This must contain storage for at least max_data_bytes.max_data_bytes[in] - 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 [opus_errorcodes)] on failure.