package vendor:opus

⌘K
Ctrl+K
or
/

    Index

    Constants (79)
    Variables (0)

    This section is empty.

    Procedures (80)
    Procedure Groups (0)

    This section is empty.

    Types

    OpusDRED ¶

    OpusDRED :: struct {}
     

    Opus DRED state. * This contains the complete state of an Opus DRED packet. * It is position independent and can be freely copied. * @see opus_dred_create,opus_dred_init

    Related Procedures With Parameters
    Related Procedures With Returns

    OpusDREDDecoder ¶

    OpusDREDDecoder :: struct {}
     

    Opus DRED decoder. * This contains the complete state of an Opus DRED decoder. * It is position independent and can be freely copied. * @see opus_dred_decoder_create,opus_dred_decoder_init

    Related Procedures With Parameters
    Related Procedures With Returns

    OpusDecoder ¶

    OpusDecoder :: struct {}
     

    Opus decoder state. * This contains the complete state of an Opus decoder. * It is position independent and can be freely copied. * @see opus_decoder_create,opus_decoder_init

    Related Procedures With Parameters
    Related Procedures With Returns

    OpusEncoder ¶

    OpusEncoder :: struct {}
     

    Opus encoder state. * This contains the complete state of an Opus encoder. * It is position independent and can be freely copied. * @see opus_encoder_create,opus_encoder_init

    Related Procedures With Parameters
    Related Procedures With Returns

    OpusRepacketizer ¶

    OpusRepacketizer :: struct {}
     

    @defgroup opus_repacketizer Repacketizer @{ * The repacketizer can be used to merge multiple Opus packets into a single packet or alternatively to split Opus packets that have previously been merged. Splitting valid Opus packets is always guaranteed to succeed, whereas merging valid packets only succeeds if all frames have the same mode, bandwidth, and frame size, and when the total duration of the merged packet is no more than 120 ms. The 120 ms limit comes from the specification and limits decoder memory requirements at a point where framing overhead becomes negligible. * The repacketizer currently only operates on elementary Opus streams. It will not manipualte multistream packets successfully, except in the degenerate case where they consist of data from a single stream. * The repacketizing process starts with creating a repacketizer state, either by calling opus_repacketizer_create() or by allocating the memory yourself, e.g., @code OpusRepacketizer *rp --- rp = (OpusRepacketizer*)malloc(opus_repacketizer_get_size()) --- if (rp != NULL) opus_repacketizer_init(rp) --- @endcode * Then the application should submit packets with opus_repacketizer_cat(), extract new packets with opus_repacketizer_out() or opus_repacketizer_out_range(), and then reset the state for the next set of input packets via opus_repacketizer_init(). * For example, to split a sequence of packets into individual frames: @code unsigned char *data --- int len --- while (get_next_packet(&data, &len)) { unsigned char out[1276] --- opus_int32 out_len --- int nb_frames --- int err --- int i --- err = opus_repacketizer_cat(rp, data, len) --- if (err != OPUS_OK) { release_packet(data) --- return err --- } nb_frames = opus_repacketizer_get_nb_frames(rp) --- for (i = 0 --- i < nb_frames --- i++) { out_len = opus_repacketizer_out_range(rp, i, i+1, out, sizeof(out)) --- if (out_len < 0) { release_packet(data) --- return (int)out_len --- } output_next_packet(out, out_len) --- } opus_repacketizer_init(rp) --- release_packet(data) --- } @endcode * Alternatively, to combine a sequence of frames into packets that each contain up to <code>TARGET_DURATION_MS</code> milliseconds of data: @code // The maximum number of packets with duration TARGET_DURATION_MS occurs // when the frame size is 2.5 ms, for a total of (TARGET_DURATION_MS*2/5) // packets. unsigned char data[(TARGET_DURATION_MS2/5)+1] --- opus_int32 len[(TARGET_DURATION_MS*2/5)+1] --- int nb_packets --- unsigned char out[1277(TARGET_DURATION_MS2/2)] --- opus_int32 out_len --- int prev_toc --- nb_packets = 0 --- while (get_next_packet(data+nb_packets, len+nb_packets)) { int nb_frames --- int err --- nb_frames = opus_packet_get_nb_frames(data[nb_packets], len[nb_packets]) --- if (nb_frames < 1) { release_packets(data, nb_packets+1) --- return nb_frames --- } nb_frames += opus_repacketizer_get_nb_frames(rp) --- // If adding the next packet would exceed our target, or it has an // incompatible TOC sequence, output the packets we already have before // submitting it. // N.B., The nb_packets > 0 check ensures we've submitted at least one // packet since the last call to opus_repacketizer_init(). Otherwise a // single packet longer than TARGET_DURATION_MS would cause us to try to // output an (invalid) empty packet. It also ensures that prev_toc has // been set to a valid value. Additionally, len[nb_packets] > 0 is // guaranteed by the call to opus_packet_get_nb_frames() above, so the // reference to data[nb_packets][0] should be valid. if (nb_packets > 0 && ( ((prev_toc & 0xFC) != (data[nb_packets][0] & 0xFC)) || opus_packet_get_samples_per_frame(data[nb_packets], 48000)*nb_frames > TARGET_DURATION_MS*48)) { out_len = opus_repacketizer_out(rp, out, sizeof(out)) --- if (out_len < 0) { release_packets(data, nb_packets+1) --- return (int)out_len --- } output_next_packet(out, out_len) --- opus_repacketizer_init(rp) --- release_packets(data, nb_packets) --- data[0] = data[nb_packets] --- len[0] = len[nb_packets] --- nb_packets = 0 --- } err = opus_repacketizer_cat(rp, data[nb_packets], len[nb_packets]) --- if (err != OPUS_OK) { release_packets(data, nb_packets+1) --- return err --- } prev_toc = data[nb_packets][0] --- nb_packets++ --- } // Output the final, partial packet. if (nb_packets > 0) { out_len = opus_repacketizer_out(rp, out, sizeof(out)) --- release_packets(data, nb_packets) --- if (out_len < 0) return (int)out_len --- output_next_packet(out, out_len) --- } @endcode * An alternate way of merging packets is to simply call opus_repacketizer_cat() unconditionally until it fails. At that point, the merged packet can be obtained with opus_repacketizer_out() and the input packet for which opus_repacketizer_cat() needs to be re-added to a newly reinitialized repacketizer state.

    Related Procedures With Parameters
    Related Procedures With Returns

    opus_int ¶

    opus_int :: i32
    Related Procedures With Parameters
    Related Procedures With Returns

    opus_int32 ¶

    opus_int32 :: i32
    Related Procedures With Parameters
    Related Procedures With Returns

    opus_int64 ¶

    opus_int64 :: i64

    opus_uint ¶

    opus_uint :: u32

    opus_uint16 ¶

    opus_uint16 :: u16
    Related Procedures With Parameters

    opus_uint32 ¶

    opus_uint32 :: u32

    opus_uint64 ¶

    opus_uint64 :: u64

    Constants

    OPUS_ALLOC_FAIL ¶

    OPUS_ALLOC_FAIL: int : -7
     

    Memory allocation has failed @hideinitializer

    OPUS_APPLICATION_AUDIO ¶

    OPUS_APPLICATION_AUDIO: int : 2049
     

    Best for broadcast/high-fidelity application where the decoded audio should be as close as possible to the input * @hideinitializer

    OPUS_APPLICATION_RESTRICTED_LOWDELAY ¶

    OPUS_APPLICATION_RESTRICTED_LOWDELAY: int : 2051
     

    Only use when lowest-achievable latency is what matters most. Voice-optimized modes cannot be used. * @hideinitializer

    OPUS_APPLICATION_VOIP ¶

    OPUS_APPLICATION_VOIP: int : 2048
     

    Best for most VoIP/videoconference applications where listening quality and intelligibility matter most * @hideinitializer

    OPUS_AUTO ¶

    OPUS_AUTO: int : -1000
     

    @defgroup opus_ctlvalues Pre-defined values for CTL interface * @see opus_genericctls, opus_encoderctls * @{

    Values for the various encoder CTLs

    OPUS_BAD_ARG ¶

    OPUS_BAD_ARG: int : -1
     

    One or more invalid/out of range arguments @hideinitializer

    OPUS_BANDWIDTH_FULLBAND ¶

    OPUS_BANDWIDTH_FULLBAND: int : 1105
     

    *<20 kHz bandpass @hideinitializer

    OPUS_BANDWIDTH_MEDIUMBAND ¶

    OPUS_BANDWIDTH_MEDIUMBAND: int : 1102
     

    *< 6 kHz bandpass @hideinitializer

    OPUS_BANDWIDTH_NARROWBAND ¶

    OPUS_BANDWIDTH_NARROWBAND: int : 1101
     

    *< 4 kHz bandpass @hideinitializer

    OPUS_BANDWIDTH_SUPERWIDEBAND ¶

    OPUS_BANDWIDTH_SUPERWIDEBAND: int : 1104
     

    *<12 kHz bandpass @hideinitializer

    OPUS_BANDWIDTH_WIDEBAND ¶

    OPUS_BANDWIDTH_WIDEBAND: int : 1103
     

    *< 8 kHz bandpass @hideinitializer

    OPUS_BITRATE_MAX ¶

    OPUS_BITRATE_MAX: int : -1
     

    *<Maximum bitrate @hideinitializer

    OPUS_BUFFER_TOO_SMALL ¶

    OPUS_BUFFER_TOO_SMALL: int : -2
     

    Not enough bytes allocated in the buffer @hideinitializer

    OPUS_FRAMESIZE_100_MS ¶

    OPUS_FRAMESIZE_100_MS: int : 5008
     

    *< Use 100 ms frames

    OPUS_FRAMESIZE_10_MS ¶

    OPUS_FRAMESIZE_10_MS: int : 5003
     

    *< Use 10 ms frames

    OPUS_FRAMESIZE_120_MS ¶

    OPUS_FRAMESIZE_120_MS: int : 5009
     

    *< Use 120 ms frames

    OPUS_FRAMESIZE_20_MS ¶

    OPUS_FRAMESIZE_20_MS: int : 5004
     

    *< Use 20 ms frames

    OPUS_FRAMESIZE_2_5_MS ¶

    OPUS_FRAMESIZE_2_5_MS: int : 5001
     

    *< Use 2.5 ms frames

    OPUS_FRAMESIZE_40_MS ¶

    OPUS_FRAMESIZE_40_MS: int : 5005
     

    *< Use 40 ms frames

    OPUS_FRAMESIZE_5_MS ¶

    OPUS_FRAMESIZE_5_MS: int : 5002
     

    *< Use 5 ms frames

    OPUS_FRAMESIZE_60_MS ¶

    OPUS_FRAMESIZE_60_MS: int : 5006
     

    *< Use 60 ms frames

    OPUS_FRAMESIZE_80_MS ¶

    OPUS_FRAMESIZE_80_MS: int : 5007
     

    *< Use 80 ms frames

    OPUS_FRAMESIZE_ARG ¶

    OPUS_FRAMESIZE_ARG: int : 5000
     

    *< Select frame size from the argument (default)

    OPUS_GET_APPLICATION_REQUEST ¶

    OPUS_GET_APPLICATION_REQUEST: int : 4001

    OPUS_GET_BANDWIDTH_REQUEST ¶

    OPUS_GET_BANDWIDTH_REQUEST: int : 4009

    OPUS_GET_BITRATE_REQUEST ¶

    OPUS_GET_BITRATE_REQUEST: int : 4003

    OPUS_GET_COMPLEXITY_REQUEST ¶

    OPUS_GET_COMPLEXITY_REQUEST: int : 4011

    OPUS_GET_DRED_DURATION_REQUEST ¶

    OPUS_GET_DRED_DURATION_REQUEST: int : 4051

    OPUS_GET_DTX_REQUEST ¶

    OPUS_GET_DTX_REQUEST: int : 4017

    OPUS_GET_EXPERT_FRAME_DURATION_REQUEST ¶

    OPUS_GET_EXPERT_FRAME_DURATION_REQUEST: int : 4041

    OPUS_GET_FINAL_RANGE_REQUEST ¶

    OPUS_GET_FINAL_RANGE_REQUEST: int : 4031

    OPUS_GET_FORCE_CHANNELS_REQUEST ¶

    OPUS_GET_FORCE_CHANNELS_REQUEST: int : 4023

    OPUS_GET_GAIN_REQUEST ¶

    OPUS_GET_GAIN_REQUEST: int : 4045
     

    Should have been 4035

    OPUS_GET_INBAND_FEC_REQUEST ¶

    OPUS_GET_INBAND_FEC_REQUEST: int : 4013

    OPUS_GET_IN_DTX_REQUEST ¶

    OPUS_GET_IN_DTX_REQUEST: int : 4049

    OPUS_GET_LAST_PACKET_DURATION_REQUEST ¶

    OPUS_GET_LAST_PACKET_DURATION_REQUEST: int : 4039

    OPUS_GET_LOOKAHEAD_REQUEST ¶

    OPUS_GET_LOOKAHEAD_REQUEST: int : 4027

    OPUS_GET_LSB_DEPTH_REQUEST ¶

    OPUS_GET_LSB_DEPTH_REQUEST: int : 4037

    OPUS_GET_MAX_BANDWIDTH_REQUEST ¶

    OPUS_GET_MAX_BANDWIDTH_REQUEST: int : 4005

    OPUS_GET_PACKET_LOSS_PERC_REQUEST ¶

    OPUS_GET_PACKET_LOSS_PERC_REQUEST: int : 4015

    OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST ¶

    OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: int : 4047

    OPUS_GET_PITCH_REQUEST ¶

    OPUS_GET_PITCH_REQUEST: int : 4033

    OPUS_GET_PREDICTION_DISABLED_REQUEST ¶

    OPUS_GET_PREDICTION_DISABLED_REQUEST: int : 4043

    OPUS_GET_SAMPLE_RATE_REQUEST ¶

    OPUS_GET_SAMPLE_RATE_REQUEST: int : 4029

    OPUS_GET_SIGNAL_REQUEST ¶

    OPUS_GET_SIGNAL_REQUEST: int : 4025

    OPUS_GET_VBR_CONSTRAINT_REQUEST ¶

    OPUS_GET_VBR_CONSTRAINT_REQUEST: int : 4021

    OPUS_GET_VBR_REQUEST ¶

    OPUS_GET_VBR_REQUEST: int : 4007

    OPUS_INTERNAL_ERROR ¶

    OPUS_INTERNAL_ERROR: int : -3
     

    An internal error was detected @hideinitializer

    OPUS_INVALID_PACKET ¶

    OPUS_INVALID_PACKET: int : -4
     

    The compressed data passed is corrupted @hideinitializer

    OPUS_INVALID_STATE ¶

    OPUS_INVALID_STATE: int : -6
     

    An encoder or decoder structure is invalid or already freed @hideinitializer

    OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST ¶

    OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST: int : 5122

    OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST ¶

    OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST: int : 5120

    OPUS_OK ¶

    OPUS_OK: int : 0
     

    No error @hideinitializer

    OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST ¶

    OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST: int : 6001

    OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST ¶

    OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST: int : 6005

    OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST ¶

    OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST: int : 6003

    OPUS_RESET_STATE ¶

    OPUS_RESET_STATE: int : 4028
     

    Resets the codec state to be equivalent to a freshly initialized state. * This should be called when switching streams in order to prevent * the back to back decoding from giving different results from * one at a time decoding. * @hideinitializer

    OPUS_SET_APPLICATION_REQUEST ¶

    OPUS_SET_APPLICATION_REQUEST: int : 4000

    OPUS_SET_BANDWIDTH_REQUEST ¶

    OPUS_SET_BANDWIDTH_REQUEST: int : 4008

    OPUS_SET_BITRATE_REQUEST ¶

    OPUS_SET_BITRATE_REQUEST: int : 4002

    OPUS_SET_COMPLEXITY_REQUEST ¶

    OPUS_SET_COMPLEXITY_REQUEST: int : 4010

    OPUS_SET_DNN_BLOB_REQUEST ¶

    OPUS_SET_DNN_BLOB_REQUEST: int : 4052

    OPUS_SET_DRED_DURATION_REQUEST ¶

    OPUS_SET_DRED_DURATION_REQUEST: int : 4050

    OPUS_SET_DTX_REQUEST ¶

    OPUS_SET_DTX_REQUEST: int : 4016

    OPUS_SET_EXPERT_FRAME_DURATION_REQUEST ¶

    OPUS_SET_EXPERT_FRAME_DURATION_REQUEST: int : 4040

    OPUS_SET_FORCE_CHANNELS_REQUEST ¶

    OPUS_SET_FORCE_CHANNELS_REQUEST: int : 4022

    OPUS_SET_GAIN_REQUEST ¶

    OPUS_SET_GAIN_REQUEST: int : 4034

    OPUS_SET_INBAND_FEC_REQUEST ¶

    OPUS_SET_INBAND_FEC_REQUEST: int : 4012

    OPUS_SET_LSB_DEPTH_REQUEST ¶

    OPUS_SET_LSB_DEPTH_REQUEST: int : 4036

    OPUS_SET_MAX_BANDWIDTH_REQUEST ¶

    OPUS_SET_MAX_BANDWIDTH_REQUEST: int : 4004

    OPUS_SET_PACKET_LOSS_PERC_REQUEST ¶

    OPUS_SET_PACKET_LOSS_PERC_REQUEST: int : 4014

    OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST ¶

    OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: int : 4046

    OPUS_SET_PREDICTION_DISABLED_REQUEST ¶

    OPUS_SET_PREDICTION_DISABLED_REQUEST: int : 4042

    OPUS_SET_SIGNAL_REQUEST ¶

    OPUS_SET_SIGNAL_REQUEST: int : 4024

    OPUS_SET_VBR_CONSTRAINT_REQUEST ¶

    OPUS_SET_VBR_CONSTRAINT_REQUEST: int : 4020

    OPUS_SET_VBR_REQUEST ¶

    OPUS_SET_VBR_REQUEST: int : 4006

    OPUS_SIGNAL_MUSIC ¶

    OPUS_SIGNAL_MUSIC: int : 3002
     

    *< Signal being encoded is music

    OPUS_SIGNAL_VOICE ¶

    OPUS_SIGNAL_VOICE: int : 3001
     

    *< Signal being encoded is voice

    OPUS_UNIMPLEMENTED ¶

    OPUS_UNIMPLEMENTED: int : -5
     

    Invalid/unsupported request number @hideinitializer

    Variables

    This section is empty.

    Procedures

    opus_decode ¶

    opus_decode :: proc "c" (
    	st:         ^OpusDecoder, 
    	data:       [^]u8, 
    	len:        i32, 
    	pcm:        [^]i16, 
    	frame_size: i32, 
    	decode_fec: i32, 
    ) -> i32 ---
     

    Decode an Opus packet. @param [in] st <tt>OpusDecoder</tt>: Decoder state @param [in] data <tt>char</tt>: Input payload. Use a NULL pointer to indicate packet loss @param [in] len <tt>opus_int32</tt>: Number of bytes in payload @param [out] pcm <tt>opus_int16</tt>: Output signal (interleaved if 2 channels). length is frame_sizechannels*sizeof(opus_int16) * @param [in] frame_size Number of samples per channel of available space in \a pcm. * If this is less than the maximum packet duration (120ms --- 5760 for 48kHz), this function will * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), * then frame_size needs to be exactly the duration of audio that is missing, otherwise the * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and * FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. * @param [in] decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be * decoded. If no such data is available, the frame is decoded as if it were lost. * @returns Number of decoded samples or @ref opus_errorcodes

    opus_decode_float ¶

    opus_decode_float :: proc "c" (
    	st:         ^OpusDecoder, 
    	data:       [^]u8, 
    	len:        i32, 
    	pcm:        [^]f32, 
    	frame_size: i32, 
    	decode_fec: i32, 
    ) -> i32 ---
     

    Decode an Opus packet with floating point output. @param [in] st <tt>OpusDecoder</tt>: Decoder state @param [in] data <tt>char</tt>: Input payload. Use a NULL pointer to indicate packet loss * @param [in] len <tt>opus_int32</tt>: Number of bytes in payload @param [out] pcm <tt>float</tt>: Output signal (interleaved if 2 channels). length is frame_sizechannels*sizeof(float) * @param [in] frame_size Number of samples per channel of available space in \a pcm. * If this is less than the maximum packet duration (120ms --- 5760 for 48kHz), this function will * not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), * then frame_size needs to be exactly the duration of audio that is missing, otherwise the * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and * FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. * @param [in] decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be * decoded. If no such data is available the frame is decoded as if it were lost. * @returns Number of decoded samples or @ref opus_errorcodes

    opus_decoder_create ¶

    opus_decoder_create :: proc "c" (Fs: i32, channels: int, error: ^i32) -> ^OpusDecoder ---
     

    Allocates and initializes a decoder state. * @param [in] Fs <tt>opus_int32</tt>: Sample rate to decode at (Hz). * This must be one of 8000, 12000, 16000, * 24000, or 48000. * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) to decode @param [out] error <tt>int</tt>: #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.

    opus_decoder_ctl ¶

    opus_decoder_ctl :: proc "c" (st: ^OpusDecoder, request: i32, .. args: ..any) -> i32 ---
     

    Perform a CTL function on an Opus decoder. * * Generally the request and subsequent arguments are generated * by a convenience macro. @param st <tt>OpusDecoder</tt>: Decoder state. * @param request This and all remaining parameters should be replaced by one * of the convenience macros in @ref opus_genericctls or * @ref opus_decoderctls. * @see opus_genericctls * @see opus_decoderctls

    opus_decoder_destroy ¶

    opus_decoder_destroy :: proc "c" (st: ^OpusDecoder) ---
     

    Frees an <code>OpusDecoder</code> allocated by opus_decoder_create(). @param[in] st <tt>OpusDecoder</tt>: State to be freed.

    opus_decoder_dred_decode ¶

    opus_decoder_dred_decode :: proc "c" (st: ^OpusDecoder, dred: ^OpusDRED, dred_offset: i32, pcm: [^]i16, frame_size: i32) -> i32 ---
     

    Decode audio from an Opus DRED packet with floating point output. @param [in] st <tt>OpusDecoder</tt>: Decoder state @param [in] dred <tt>OpusDRED</tt>: DRED state * @param [in] dred_offset <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet). @param [out] pcm <tt>opus_int16</tt>: Output signal (interleaved if 2 channels). length is frame_sizechannels*sizeof(opus_int16) * @param [in] frame_size Number of samples per channel to decode in \a pcm. * frame_size <b>must</b> be a multiple of 2.5 ms. * @returns Number of decoded samples or @ref opus_errorcodes

    opus_decoder_dred_decode_float ¶

    opus_decoder_dred_decode_float :: proc "c" (st: ^OpusDecoder, dred: ^OpusDRED, dred_offset: i32, pcm: [^]f32, frame_size: i32) -> i32 ---
     

    Decode audio from an Opus DRED packet with floating point output. @param [in] st <tt>OpusDecoder</tt>: Decoder state @param [in] dred <tt>OpusDRED</tt>: DRED state * @param [in] dred_offset <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet). @param [out] pcm <tt>float</tt>: Output signal (interleaved if 2 channels). length is frame_sizechannels*sizeof(float) * @param [in] frame_size Number of samples per channel to decode in \a pcm. * frame_size <b>must</b> be a multiple of 2.5 ms. * @returns Number of decoded samples or @ref opus_errorcodes

    opus_decoder_get_nb_samples ¶

    opus_decoder_get_nb_samples :: proc "c" (dec: ^OpusDecoder, packet: [^]u8, len: i32) -> i32 ---
     

    Gets the number of samples of an Opus packet. @param [in] dec <tt>OpusDecoder</tt>: Decoder state @param [in] packet <tt>char</tt>: Opus packet * @param [in] len <tt>opus_int32</tt>: Length of packet * @returns Number of samples * @retval OPUS_BAD_ARG Insufficient data was passed to the function * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

    opus_decoder_get_size ¶

    opus_decoder_get_size :: proc "c" (channels: i32) -> i32 ---
     

    Gets the size of an <code>OpusDecoder</code> structure. * @param [in] channels <tt>int</tt>: Number of channels. * This must be 1 or 2. * @returns The size in bytes.

    opus_decoder_init ¶

    opus_decoder_init :: proc "c" (st: ^OpusDecoder, Fs: i32, channels: i32) -> i32 ---
     

    Initializes a previously allocated decoder state. * The state must be at least the size returned by opus_decoder_get_size(). * This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @param [in] st <tt>OpusDecoder</tt>: Decoder state. * @param [in] Fs <tt>opus_int32</tt>: Sampling rate to decode to (Hz). * This must be one of 8000, 12000, 16000, * 24000, or 48000. * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) to decode * @retval #OPUS_OK Success or @ref opus_errorcodes

    opus_dred_alloc ¶

    opus_dred_alloc :: proc "c" (error: ^i32) -> OpusDRED ---
     

    Allocates and initializes a DRED state. @param [out] error <tt>int</tt>: #OPUS_OK Success or @ref opus_errorcodes

    opus_dred_decoder_create ¶

    opus_dred_decoder_create :: proc "c" (error: ^i32) -> ^OpusDREDDecoder ---
     

    Allocates and initializes an OpusDREDDecoder state. @param [out] error <tt>int</tt>: #OPUS_OK Success or @ref opus_errorcodes

    opus_dred_decoder_ctl ¶

    opus_dred_decoder_ctl :: proc "c" (dred_dec: ^OpusDREDDecoder, request: i32, .. args: ..any) -> i32 ---
     

    Perform a CTL function on an Opus DRED decoder. * * Generally the request and subsequent arguments are generated * by a convenience macro. @param dred_dec <tt>OpusDREDDecoder</tt>: DRED Decoder state. * @param request This and all remaining parameters should be replaced by one * of the convenience macros in @ref opus_genericctls or * @ref opus_decoderctls. * @see opus_genericctls * @see opus_decoderctls

    opus_dred_decoder_destroy ¶

    opus_dred_decoder_destroy :: proc "c" (dec: ^OpusDREDDecoder) ---
     

    Frees an <code>OpusDREDDecoder</code> allocated by opus_dred_decoder_create(). @param[in] dec <tt>OpusDREDDecoder</tt>: State to be freed.

    opus_dred_decoder_get_size ¶

    opus_dred_decoder_get_size :: proc "c" () -> i32 ---
     

    Gets the size of an <code>OpusDREDDecoder</code> structure. * @returns The size in bytes.

    opus_dred_decoder_init ¶

    opus_dred_decoder_init :: proc "c" (dec: ^OpusDREDDecoder) -> i32 ---
     

    Initializes an <code>OpusDREDDecoder</code> state. @param[in] dec <tt>OpusDREDDecoder</tt>: State to be initialized.

    opus_dred_free ¶

    opus_dred_free :: proc "c" (dec: ^OpusDRED) ---
     

    Frees an <code>OpusDRED</code> allocated by opus_dred_create(). @param[in] dec <tt>OpusDRED</tt>: State to be freed.

    opus_dred_get_size ¶

    opus_dred_get_size :: proc "c" () -> i32 ---
     

    Gets the size of an <code>OpusDRED</code> structure. * @returns The size in bytes.

    opus_dred_parse ¶

    opus_dred_parse :: proc "c" (
    	dred_dec:         ^OpusDREDDecoder, 
    	dred:             ^OpusDRED, 
    	data:             [^]u8, 
    	len:              i32, 
    	max_dred_samples: i32, 
    	sampling_rate:    i32, 
    	dred_end:         i32, 
    	defer_processing: i32, 
    ) -> i32 ---
     

    Decode an Opus DRED packet. @param [in] dred_dec <tt>OpusDRED</tt>: DRED Decoder state @param [in] dred <tt>OpusDRED</tt>: DRED state @param [in] data <tt>char</tt>: Input payload * @param [in] len <tt>opus_int32</tt>: Number of bytes in payload * @param [in] max_dred_samples <tt>opus_int32</tt>: Maximum number of DRED samples that may be needed (if available in the packet). * @param [in] sampling_rate <tt>opus_int32</tt>: Sampling rate used for max_dred_samples argument. Needs not match the actual sampling rate of the decoder. @param [out] dred_end <tt>opus_int32</tt>: Number of non-encoded (silence) samples between the DRED timestamp and the last DRED sample. * @param [in] defer_processing <tt>int</tt>: Flag (0 or 1). If set to one, the CPU-intensive part of the DRED decoding is deferred until opus_dred_process() is called. * @returns Offset (positive) of the first decoded DRED samples, zero if no DRED is present, or @ref opus_errorcodes

    opus_dred_process ¶

    opus_dred_process :: proc "c" (dred_dec: ^OpusDREDDecoder, src: ^OpusDRED, dst: ^OpusDRED) -> i32 ---
     

    Finish decoding an Opus DRED packet. The function only needs to be called if opus_dred_parse() was called with defer_processing=1. * The source and destination will often be the same DRED state. @param [in] dred_dec <tt>OpusDRED</tt>: DRED Decoder state @param [in] src <tt>OpusDRED</tt>: Source DRED state to start the processing from. @param [out] dst <tt>OpusDRED</tt>: Destination DRED state to store the updated state after processing. * @returns @ref opus_errorcodes

    opus_encode ¶

    opus_encode :: proc "c" (st: ^OpusEncoder, pcm: [^]i16, frame_size: i32, data: [^]u8, max_data_bytes: i32) -> i32 ---
     

    Encodes an Opus frame. @param [in] st <tt>OpusEncoder</tt>: Encoder state @param [in] pcm <tt>opus_int16</tt>: Input signal (interleaved if 2 channels). length is frame_sizechannelssizeof(opus_int16) * @param [in] frame_size <tt>int</tt>: 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. @param [out] data <tt>unsigned char</tt>: Output payload. * This must contain storage for at * least \a max_data_bytes. * @param [in] max_data_bytes <tt>opus_int32</tt>: 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.

    opus_encode_float ¶

    opus_encode_float :: proc "c" (st: ^OpusEncoder, pcm: [^]f32, frame_size: i32, data: [^]u8, max_data_bytes: i32) -> i32 ---
     

    Encodes an Opus frame from floating point input. @param [in] st <tt>OpusEncoder</tt>: Encoder state @param [in] pcm <tt>float</tt>: 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_sizechannels*sizeof(float) * @param [in] frame_size <tt>int</tt>: 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. @param [out] data <tt>unsigned char</tt>: Output payload. * This must contain storage for at * least \a max_data_bytes. * @param [in] max_data_bytes <tt>opus_int32</tt>: 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.

    opus_encoder_create ¶

    opus_encoder_create :: proc "c" (Fs: i32, channels: int, application: i32, error: ^i32) -> ^OpusEncoder ---
     

    Allocates and initializes an encoder state. * There are three coding modes: * * @ref OPUS_APPLICATION_VOIP gives best quality at a given bitrate for voice * signals. It enhances the input signal by high-pass filtering and * emphasizing formants and harmonics. Optionally it includes in-band * forward error correction to protect against packet loss. Use this * mode for typical VoIP applications. Because of the enhancement, * even at high bitrates the output may sound different from the input. * * @ref OPUS_APPLICATION_AUDIO gives best quality at a given bitrate for most * non-voice signals like music. Use this mode for music and mixed * (music/voice) content, broadcast, and applications requiring less * than 15 ms of coding delay. * * @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY configures low-delay mode that * disables the speech-optimized mode in exchange for slightly reduced delay. * This mode can only be set on an newly initialized or freshly reset encoder * because it changes the codec delay. * * This is useful when the caller knows that the speech-optimized modes will not be needed (use with caution). * @param [in] Fs <tt>opus_int32</tt>: Sampling rate of input signal (Hz) * This must be one of 8000, 12000, 16000, * 24000, or 48000. * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal * @param [in] application <tt>int</tt>: Coding mode (one of @ref OPUS_APPLICATION_VOIP, @ref OPUS_APPLICATION_AUDIO, or @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY) @param [out] error <tt>int</tt>: @ref opus_errorcodes * @note Regardless of the sampling rate and number channels selected, the Opus encoder * can switch to a lower audio bandwidth or number of channels if the bitrate * selected is too low. This also means that it is safe to always use 48 kHz stereo input * and let the encoder optimize the encoding.

    opus_encoder_ctl ¶

    opus_encoder_ctl :: proc "c" (st: ^OpusEncoder, request: i32, .. args: ..any) -> i32 ---
     

    Perform a CTL function on an Opus encoder. * * Generally the request and subsequent arguments are generated * by a convenience macro. @param st <tt>OpusEncoder</tt>: Encoder state. * @param request This and all remaining parameters should be replaced by one * of the convenience macros in @ref opus_genericctls or * @ref opus_encoderctls. * @see opus_genericctls * @see opus_encoderctls

    opus_encoder_destroy ¶

    opus_encoder_destroy :: proc "c" (st: ^OpusEncoder) ---
     

    Frees an <code>OpusEncoder</code> allocated by opus_encoder_create(). @param[in] st <tt>OpusEncoder</tt>: State to be freed.

    opus_encoder_get_size ¶

    opus_encoder_get_size :: proc "c" (channels: i32) -> i32 ---
     

    Gets the size of an <code>OpusEncoder</code> structure. * @param[in] channels <tt>int</tt>: Number of channels. * This must be 1 or 2. * @returns The size in bytes.

    opus_encoder_init ¶

    opus_encoder_init :: proc "c" (st: ^OpusEncoder, Fs: i32, channels: i32, application: i32) -> i32 ---
     

    Initializes a previously allocated encoder state * The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). * This is intended for applications which use their own allocator instead of malloc. * @see opus_encoder_create(),opus_encoder_get_size() * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @param [in] st <tt>OpusEncoder</tt>: Encoder state * @param [in] Fs <tt>opus_int32</tt>: Sampling rate of input signal (Hz) * This must be one of 8000, 12000, 16000, * 24000, or 48000. * @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal * @param [in] application <tt>int</tt>: Coding mode (one of OPUS_APPLICATION_VOIP, OPUS_APPLICATION_AUDIO, or OPUS_APPLICATION_RESTRICTED_LOWDELAY) * @retval #OPUS_OK Success or @ref opus_errorcodes

    opus_get_version_string ¶

    opus_get_version_string :: proc "c" () -> cstring ---

    opus_multistream_decode ¶

    opus_multistream_decode :: proc "c" (
    	st:         ^OpusMSDecoder, 
    	data:       [^]u8, 
    	len:        i32, 
    	pcm:        [^]i16, 
    	frame_size: i32, 
    	decode_fec: i32, 
    ) -> i32 ---
     

    Decode a multistream Opus packet. @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state. @param[in] data <tt>const unsigned char*</tt>: Input payload. Use a <code>NULL</code> pointer to indicate packet loss. @param len <tt>opus_int32</tt>: Number of bytes in payload. @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved samples. This must contain room for <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: The number of samples per channel of available space in \a pcm. If this is less than the maximum packet duration (120 ms --- 5760 for 48kHz), this function will not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing, otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available, the frame is decoded as if it were lost. @returns Number of samples decoded on success or a negative error code (see @ref opus_errorcodes) on failure.

    opus_multistream_decode_float ¶

    opus_multistream_decode_float :: proc "c" (
    	st:         ^OpusMSDecoder, 
    	data:       [^]u8, 
    	len:        i32, 
    	pcm:        [^]f32, 
    	frame_size: i32, 
    	decode_fec: i32, 
    ) -> i32 ---
     

    Decode a multistream Opus packet with floating point output. @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state. @param[in] data <tt>const unsigned char*</tt>: Input payload. Use a <code>NULL</code> pointer to indicate packet loss. @param len <tt>opus_int32</tt>: Number of bytes in payload. @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved samples. This must contain room for <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: The number of samples per channel of available space in \a pcm. If this is less than the maximum packet duration (120 ms --- 5760 for 48kHz), this function will not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing, otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available, the frame is decoded as if it were lost. @returns Number of samples decoded on success or a negative error code (see @ref opus_errorcodes) on failure.

    opus_multistream_decoder_create ¶

    opus_multistream_decoder_create :: proc "c" (
    	Fs:              i32, 
    	channels:        i32, 
    	streams:         i32, 
    	coupled_streams: i32, 
    	mapping:         [^]u8, 
    	error:           ^i32, 
    ) -> ^OpusMSDecoder ---
     

    Allocates and initializes a multistream decoder state. Call opus_multistream_decoder_destroy() to release this object when finished. @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels to output. This must be at most 255. It may be different from the number of coded channels (<code>streams + coupled_streams</code>). @param streams <tt>int</tt>: The total number of streams coded in the input. This must be no more than 255. @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of coded channels (<code>streams + coupled_streams</code>) must be no more than 255. @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from coded channels to output channels, as described in @ref opus_multistream. @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_multistream_decoder_ctl ¶

    opus_multistream_decoder_ctl :: proc "c" (st: ^OpusMSDecoder, request: i32, .. args: ..any) -> i32 ---
     

    Perform a CTL function on a multistream Opus decoder. * Generally the request and subsequent arguments are generated by a convenience macro. @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state. @param request This and all remaining parameters should be replaced by one of the convenience macros in @ref opus_genericctls, @ref opus_decoderctls, or @ref opus_multistream_ctls. @see opus_genericctls @see opus_decoderctls @see opus_multistream_ctls

    opus_multistream_decoder_destroy ¶

    opus_multistream_decoder_destroy :: proc "c" (st: ^OpusMSDecoder) ---
     

    Frees an <code>OpusMSDecoder</code> allocated by opus_multistream_decoder_create(). @param st <tt>OpusMSDecoder</tt>: Multistream decoder state to be freed.

    opus_multistream_decoder_get_size ¶

    opus_multistream_decoder_get_size :: proc "c" (streams: i32, coupled_streams: i32) -> i32 ---
     

    Gets the size of an <code>OpusMSDecoder</code> structure. @param streams <tt>int</tt>: The total number of streams coded in the input. This must be no more than 255. @param coupled_streams <tt>int</tt>: Number streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of coded channels (<code>streams + coupled_streams</code>) must be no more than 255. @returns The size in bytes on success, or a negative error code (see @ref opus_errorcodes) on error.

    opus_multistream_decoder_init ¶

    opus_multistream_decoder_init :: proc "c" (
    	st:              ^OpusMSDecoder, 
    	Fs:              i32, 
    	channels:        i32, 
    	streams:         i32, 
    	coupled_streams: i32, 
    	mapping:         [^]u8, 
    ) -> i32 ---
     

    Intialize a previously allocated decoder state object. The memory pointed to by \a st must be at least the size returned by opus_multistream_encoder_get_size(). This is intended for applications which use their own allocator instead of malloc. To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @see opus_multistream_decoder_create @see opus_multistream_deocder_get_size @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to initialize. @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels to output. This must be at most 255. It may be different from the number of coded channels (<code>streams + coupled_streams</code>). @param streams <tt>int</tt>: The total number of streams coded in the input. This must be no more than 255. @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of coded channels (<code>streams + coupled_streams</code>) must be no more than 255. @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from coded channels to output channels, as described in @ref opus_multistream. @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_multistream_encode ¶

    opus_multistream_encode :: proc "c" (st: ^OpusMSEncoder, pcm: [^]u16, frame_size: i32, data: [^]u8, max_data_bytes: i32) -> i32 ---
     

    Encodes a multistream Opus frame. @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. @param[in] pcm <tt>const opus_int16*</tt>: The input signal as interleaved samples. This must contain <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: 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. @param[out] data <tt>unsigned char*</tt>: Output payload. This must contain storage for at least \a max_data_bytes. @param [in] max_data_bytes <tt>opus_int32</tt>: 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.

    opus_multistream_encode_float ¶

    opus_multistream_encode_float :: proc "c" (st: ^OpusMSEncoder, pcm: [^]f32, frame_size: i32, data: [^]u8, max_data_bytes: i32) -> i32 ---
     

    Encodes a multistream Opus frame from floating point input. @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. @param[in] pcm <tt>const float*</tt>: The input signal as interleaved samples 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. This must contain <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: 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. @param[out] data <tt>unsigned char*</tt>: Output payload. This must contain storage for at least \a max_data_bytes. @param [in] max_data_bytes <tt>opus_int32</tt>: 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.

    opus_multistream_encoder_create ¶

    opus_multistream_encoder_create :: proc "c" (
    	Fs:              i32, 
    	channels:        i32, 
    	streams:         i32, 
    	coupled_streams: i32, 
    	mapping:         [^]u8, 
    	application:     i32, 
    	error:           ^i32, 
    ) -> ^OpusMSEncoder ---
     

    Allocates and initializes a multistream encoder state. Call opus_multistream_encoder_destroy() to release this object when finished. @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels in the input signal. This must be at most 255. It may be greater than the number of coded channels (<code>streams + coupled_streams</code>). @param streams <tt>int</tt>: The total number of streams to encode from the input. This must be no more than the number of channels. @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams to encode. This must be no larger than the total number of streams. Additionally, The total number of encoded channels (<code>streams + coupled_streams</code>) must be no more than the number of input channels. @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from encoded channels to input channels, as described in @ref opus_multistream. As an extra constraint, the multistream encoder does not allow encoding coupled streams for which one channel is unused since this is never a good idea. @param application <tt>int</tt>: The target encoder application. This must be one of the following: <dl> <dt>#OPUS_APPLICATION_VOIP</dt> <dd>Process signal for improved speech intelligibility.</dd> <dt>#OPUS_APPLICATION_AUDIO</dt> <dd>Favor faithfulness to the original input.</dd> <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> <dd>Configure the minimum possible coding delay by disabling certain modes of operation.</dd> </dl> @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_multistream_encoder_ctl ¶

    opus_multistream_encoder_ctl :: proc "c" (st: ^OpusMSEncoder, request: i32, .. args: ..any) -> i32 ---
     

    Perform a CTL function on a multistream Opus encoder. * Generally the request and subsequent arguments are generated by a convenience macro. @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. @param request This and all remaining parameters should be replaced by one of the convenience macros in @ref opus_genericctls, @ref opus_encoderctls, or @ref opus_multistream_ctls. @see opus_genericctls @see opus_encoderctls @see opus_multistream_ctls

    opus_multistream_encoder_destroy ¶

    opus_multistream_encoder_destroy :: proc "c" (st: ^OpusMSEncoder) ---
     

    Frees an <code>OpusMSEncoder</code> allocated by opus_multistream_encoder_create(). @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to be freed.

    opus_multistream_encoder_get_size ¶

    opus_multistream_encoder_get_size :: proc "c" (streams: i32, coupled_streams: i32) -> i32 ---
     

    Gets the size of an OpusMSEncoder structure. * @param streams <tt>int</tt>: The total number of streams to encode from the * input. * This must be no more than 255. * @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams * to encode. * This must be no larger than the total * number of streams. * Additionally, The total number of * encoded channels (<code>streams + * coupled_streams</code>) must be no * more than 255. * @returns The size in bytes on success, or a negative error code * (see @ref opus_errorcodes) on error.

    opus_multistream_encoder_init ¶

    opus_multistream_encoder_init :: proc "c" (
    	st:              ^OpusMSEncoder, 
    	Fs:              i32, 
    	channels:        i32, 
    	streams:         i32, 
    	coupled_streams: i32, 
    	mapping:         [^]u8, 
    	application:     i32, 
    ) -> i32 ---
     

    Initialize a previously allocated multistream encoder state. The memory pointed to by \a st must be at least the size returned by opus_multistream_encoder_get_size(). This is intended for applications which use their own allocator instead of malloc. To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @see opus_multistream_encoder_create @see opus_multistream_encoder_get_size @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to initialize. @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels in the input signal. This must be at most 255. It may be greater than the number of coded channels (<code>streams + coupled_streams</code>). @param streams <tt>int</tt>: The total number of streams to encode from the input. This must be no more than the number of channels. @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams to encode. This must be no larger than the total number of streams. Additionally, The total number of encoded channels (<code>streams + coupled_streams</code>) must be no more than the number of input channels. @param[in] mapping <code>const unsigned char[channels]</code>: Mapping from encoded channels to input channels, as described in @ref opus_multistream. As an extra constraint, the multistream encoder does not allow encoding coupled streams for which one channel is unused since this is never a good idea. @param application <tt>int</tt>: The target encoder application. This must be one of the following: <dl> <dt>#OPUS_APPLICATION_VOIP</dt> <dd>Process signal for improved speech intelligibility.</dd> <dt>#OPUS_APPLICATION_AUDIO</dt> <dd>Favor faithfulness to the original input.</dd> <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> <dd>Configure the minimum possible coding delay by disabling certain modes of operation.</dd> </dl> @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_multistream_packet_pad ¶

    opus_multistream_packet_pad :: proc "c" (data: [^]u8, len: i32, new_len: i32, nb_streams: i32) -> i32 ---
     

    Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence). @param[in,out] data <tt>const unsigned char</tt>: The buffer containing the * packet to pad. * @param len <tt>opus_int32</tt>: The size of the packet. * This must be at least 1. * @param new_len <tt>opus_int32</tt>: The desired size of the packet after padding. * This must be at least 1. * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels) in the packet. * This must be at least as large as len. * @returns an error code * @retval #OPUS_OK \a on success. * @retval #OPUS_BAD_ARG \a len was less than 1. * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

    opus_multistream_packet_unpad ¶

    opus_multistream_packet_unpad :: proc "c" (data: [^]u8, len: i32, nb_streams: i32) -> i32 ---
     

    Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to * minimize space usage. @param[in,out] data <tt>const unsigned char</tt>: The buffer containing the * packet to strip. * @param len <tt>opus_int32</tt>: The size of the packet. * This must be at least 1. * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels) in the packet. * This must be at least 1. * @returns The new size of the output packet on success, or an error code * on failure. * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

    opus_multistream_surround_encoder_create ¶

    opus_multistream_surround_encoder_create :: proc "c" (
    	Fs:              i32, 
    	channels:        i32, 
    	mapping_family:  i32, 
    	streams:         [^]i32, 
    	coupled_streams: [^]i32, 
    	mapping:         [^]u8, 
    	application:     i32, 
    	error:           ^i32, 
    ) -> ^OpusMSEncoder ---

    opus_multistream_surround_encoder_get_size ¶

    opus_multistream_surround_encoder_get_size :: proc "c" (channels: i32, mapping_family: i32) -> i32 ---

    opus_multistream_surround_encoder_init ¶

    opus_multistream_surround_encoder_init :: proc "c" (
    	st:              ^OpusMSEncoder, 
    	Fs:              i32, 
    	channels:        i32, 
    	mapping_family:  i32, 
    	streams:         [^]i32, 
    	coupled_streams: [^]i32, 
    	mapping:         [^]u8, 
    	application:     i32, 
    ) -> i32 ---

    opus_packet_get_bandwidth ¶

    opus_packet_get_bandwidth :: proc "c" (data: [^]u8) -> i32 ---
     

    Gets the bandwidth of an Opus packet. @param [in] data <tt>char</tt>: Opus packet * @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) * @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) * @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) * @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) * @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

    opus_packet_get_nb_channels ¶

    opus_packet_get_nb_channels :: proc "c" (data: [^]u8) -> i32 ---
     

    Gets the number of channels from an Opus packet. @param [in] data <tt>char</tt>: Opus packet * @returns Number of channels * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

    opus_packet_get_nb_frames ¶

    opus_packet_get_nb_frames :: proc "c" (packet: [^]u8, len: i32) -> i32 ---
     

    Gets the number of frames in an Opus packet. @param [in] packet <tt>char</tt>: Opus packet * @param [in] len <tt>opus_int32</tt>: Length of packet * @returns Number of frames * @retval OPUS_BAD_ARG Insufficient data was passed to the function * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

    opus_packet_get_nb_samples ¶

    opus_packet_get_nb_samples :: proc "c" (packet: [^]u8, len: i32, Fs: i32) -> i32 ---
     

    Gets the number of samples of an Opus packet. @param [in] packet <tt>char</tt>: Opus packet * @param [in] len <tt>opus_int32</tt>: Length of packet * @param [in] Fs <tt>opus_int32</tt>: Sampling rate in Hz. * This must be a multiple of 400, or * inaccurate results will be returned. * @returns Number of samples * @retval OPUS_BAD_ARG Insufficient data was passed to the function * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

    opus_packet_get_samples_per_frame ¶

    opus_packet_get_samples_per_frame :: proc "c" (data: [^]u8, Fs: i32) -> i32 ---
     

    Gets the number of samples per frame from an Opus packet. @param [in] data <tt>char</tt>: Opus packet. * This must contain at least one byte of * data. * @param [in] Fs <tt>opus_int32</tt>: Sampling rate in Hz. * This must be a multiple of 400, or * inaccurate results will be returned. * @returns Number of samples per frame.

    opus_packet_has_lbrr ¶

    opus_packet_has_lbrr :: proc "c" (packet: [^]u8, len: i32) -> i32 ---
     

    Checks whether an Opus packet has LBRR. @param [in] packet <tt>char</tt>: Opus packet * @param [in] len <tt>opus_int32</tt>: Length of packet * @returns 1 is LBRR is present, 0 otherwise * @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

    opus_packet_pad ¶

    opus_packet_pad :: proc "c" (data: [^]u8, len: i32, new_len: i32) -> i32 ---
     

    Pads a given Opus packet to a larger size (possibly changing the TOC sequence). @param[in,out] data <tt>const unsigned char</tt>: The buffer containing the * packet to pad. * @param len <tt>opus_int32</tt>: The size of the packet. * This must be at least 1. * @param new_len <tt>opus_int32</tt>: The desired size of the packet after padding. * This must be at least as large as len. * @returns an error code * @retval #OPUS_OK \a on success. * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

    opus_packet_parse ¶

    opus_packet_parse :: proc "c" (
    	data:           [^]u8, 
    	len:            i32, 
    	out_toc:        ^u8, 
    	frames:         [^]u8, 
    	size:           [^]i16, 
    	payload_offset: ^i32, 
    ) -> i32 ---
     

    Parse an opus packet into one or more frames. * Opus_decode will perform this operation internally so most applications do * not need to use this function. * This function does not copy the frames, the returned pointers are pointers into * the input packet. @param [in] data <tt>char</tt>: Opus packet to be parsed * @param [in] len <tt>opus_int32</tt>: size of data @param [out] out_toc <tt>char</tt>: TOC pointer @param [out] frames <tt>char[48]</tt> encapsulated frames * @param [out] size <tt>opus_int16[48]</tt> sizes of the encapsulated frames @param [out] payload_offset <tt>int</tt>: returns the position of the payload within the packet (in bytes) * @returns number of frames

    opus_packet_unpad ¶

    opus_packet_unpad :: proc "c" (data: [^]u8, len: i32) -> i32 ---
     

    Remove all padding from a given Opus packet and rewrite the TOC sequence to * minimize space usage. @param[in,out] data <tt>const unsigned char</tt>: The buffer containing the * packet to strip. * @param len <tt>opus_int32</tt>: The size of the packet. * This must be at least 1. * @returns The new size of the output packet on success, or an error code * on failure. * @retval #OPUS_BAD_ARG \a len was less than 1. * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

    opus_pcm_soft_clip ¶

    opus_pcm_soft_clip :: proc "c" (pcm: [^]f32, frame_size: i32, channels: i32, softclip_mem: [^]f32) ---
     

    Applies soft-clipping to bring a float signal within the [-1,1] range. If * the signal is already in that range, nothing is done. If there are values * outside of [-1,1], then the signal is clipped as smoothly as possible to * both fit in the range and avoid creating excessive distortion in the * process. @param [in,out] pcm <tt>float</tt>: Input PCM and modified PCM * @param [in] frame_size <tt>int</tt> Number of samples per channel to process * @param [in] channels <tt>int</tt>: Number of channels @param [in,out] softclip_mem <tt>float</tt>: State memory for the soft clipping process (one float per channel, initialized to zero)

    opus_projection_ambisonics_encoder_create ¶

    opus_projection_ambisonics_encoder_create :: proc "c" (
    	Fs:              i32, 
    	channels:        i32, 
    	mapping_family:  i32, 
    	streams:         [^]i32, 
    	coupled_streams: [^]i32, 
    	mapping:         [^]u8, 
    	application:     i32, 
    	error:           ^i32, 
    ) -> ^OpusProjectionEncoder ---
     

    Allocates and initializes a projection encoder state. Call opus_projection_encoder_destroy() to release this object when finished. @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels in the input signal. This must be at most 255. It may be greater than the number of coded channels (<code>streams + coupled_streams</code>). @param mapping_family <tt>int</tt>: The mapping family to use for selecting the appropriate projection. @param[out] streams <tt>int *</tt>: The total number of streams that will be encoded from the input. @param[out] coupled_streams <tt>int *</tt>: Number of coupled (2 channel) streams that will be encoded from the input. @param application <tt>int</tt>: The target encoder application. This must be one of the following: <dl> <dt>#OPUS_APPLICATION_VOIP</dt> <dd>Process signal for improved speech intelligibility.</dd> <dt>#OPUS_APPLICATION_AUDIO</dt> <dd>Favor faithfulness to the original input.</dd> <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> <dd>Configure the minimum possible coding delay by disabling certain modes of operation.</dd> </dl> @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_projection_ambisonics_encoder_get_size ¶

    opus_projection_ambisonics_encoder_get_size :: proc "c" (channels: i32, mapping_family: i32) -> i32 ---
     

    Gets the size of an OpusProjectionEncoder structure. * @param channels <tt>int</tt>: The total number of input channels to encode. * This must be no more than 255. * @param mapping_family <tt>int</tt>: The mapping family to use for selecting * the appropriate projection. * @returns The size in bytes on success, or a negative error code * (see @ref opus_errorcodes) on error.

    opus_projection_ambisonics_encoder_init ¶

    opus_projection_ambisonics_encoder_init :: proc "c" (
    	st:              ^OpusProjectionEncoder, 
    	Fs:              i32, 
    	channels:        i32, 
    	mapping_family:  i32, 
    	streams:         [^]i32, 
    	coupled_streams: [^]i32, 
    	application:     i32, 
    ) -> i32 ---
     

    Initialize a previously allocated projection encoder state. The memory pointed to by \a st must be at least the size returned by opus_projection_ambisonics_encoder_get_size(). This is intended for applications which use their own allocator instead of malloc. To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @see opus_projection_ambisonics_encoder_create @see opus_projection_ambisonics_encoder_get_size @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state to initialize. @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels in the input signal. This must be at most 255. It may be greater than the number of coded channels (<code>streams + coupled_streams</code>). @param streams <tt>int</tt>: The total number of streams to encode from the input. This must be no more than the number of channels. @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams to encode. This must be no larger than the total number of streams. Additionally, The total number of encoded channels (<code>streams + coupled_streams</code>) must be no more than the number of input channels. @param application <tt>int</tt>: The target encoder application. This must be one of the following: <dl> <dt>#OPUS_APPLICATION_VOIP</dt> <dd>Process signal for improved speech intelligibility.</dd> <dt>#OPUS_APPLICATION_AUDIO</dt> <dd>Favor faithfulness to the original input.</dd> <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt> <dd>Configure the minimum possible coding delay by disabling certain modes of operation.</dd> </dl> @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_projection_decode ¶

    opus_projection_decode :: proc "c" (
    	st:         ^OpusProjectionDecoder, 
    	data:       [^]u8, 
    	len:        i32, 
    	pcm:        [^]i16, 
    	frame_size: i32, 
    	decode_fec: i32, 
    ) -> i32 ---
     

    Decode a projection Opus packet. @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state. @param[in] data <tt>const unsigned char*</tt>: Input payload. Use a <code>NULL</code> pointer to indicate packet loss. @param len <tt>opus_int32</tt>: Number of bytes in payload. @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved samples. This must contain room for <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: The number of samples per channel of available space in \a pcm. If this is less than the maximum packet duration (120 ms --- 5760 for 48kHz), this function will not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing, otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available, the frame is decoded as if it were lost. @returns Number of samples decoded on success or a negative error code (see @ref opus_errorcodes) on failure.

    opus_projection_decode_float ¶

    opus_projection_decode_float :: proc "c" (
    	st:         ^OpusProjectionDecoder, 
    	data:       [^]u8, 
    	len:        i32, 
    	pcm:        [^]f32, 
    	frame_size: i32, 
    	decode_fec: i32, 
    ) -> i32 ---
     

    Decode a projection Opus packet with floating point output. @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state. @param[in] data <tt>const unsigned char*</tt>: Input payload. Use a <code>NULL</code> pointer to indicate packet loss. @param len <tt>opus_int32</tt>: Number of bytes in payload. @param[out] pcm <tt>float</tt>: Output signal, with interleaved////opus_int16*</tt>: Output signal, with interleaved samples. This must contain room for <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: The number of samples per channel of available space in \a pcm. If this is less than the maximum packet duration (120 ms --- 5760 for 48kHz), this function will not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing, otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size <b>must</b> be a multiple of 2.5 ms. @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available, the frame is decoded as if it were lost. @returns Number of samples decoded on success or a negative error code (see @ref opus_errorcodes) on failure.

    opus_projection_decoder_create ¶

    opus_projection_decoder_create :: proc "c" (
    	Fs:                   i32, 
    	channels:             i32, 
    	streams:              i32, 
    	coupled_streams:      i32, 
    	demixing_matrix:      [^]u8, 
    	demixing_matrix_size: i32, 
    	error:                ^i32, 
    ) -> ^OpusProjectionDecoder ---
     

    Allocates and initializes a projection decoder state. Call opus_projection_decoder_destroy() to release this object when finished. @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels to output. This must be at most 255. It may be different from the number of coded channels (<code>streams + coupled_streams</code>). @param streams <tt>int</tt>: The total number of streams coded in the input. This must be no more than 255. @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of coded channels (<code>streams + coupled_streams</code>) must be no more than 255. @param[in] demixing_matrix <tt>const unsigned char[demixing_matrix_size]</tt>: Demixing matrix that mapping from coded channels to output channels, as described in @ref opus_projection and @ref opus_projection_ctls. @param demixing_matrix_size <tt>opus_int32</tt>: The size in bytes of the demixing matrix, as described in @ref opus_projection_ctls. @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_projection_decoder_ctl ¶

    opus_projection_decoder_ctl :: proc "c" (st: ^OpusProjectionDecoder, request: i32, .. args: ..any) -> i32 ---
     

    Perform a CTL function on a projection Opus decoder. * Generally the request and subsequent arguments are generated by a convenience macro. @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state. @param request This and all remaining parameters should be replaced by one of the convenience macros in @ref opus_genericctls, @ref opus_decoderctls, @ref opus_multistream_ctls, or @ref opus_projection_ctls. @see opus_genericctls @see opus_decoderctls @see opus_multistream_ctls @see opus_projection_ctls

    opus_projection_decoder_destroy ¶

    opus_projection_decoder_destroy :: proc "c" (st: ^OpusProjectionDecoder) ---
     

    Frees an <code>OpusProjectionDecoder</code> allocated by opus_projection_decoder_create(). @param st <tt>OpusProjectionDecoder</tt>: Projection decoder state to be freed.

    opus_projection_decoder_get_size ¶

    opus_projection_decoder_get_size :: proc "c" (channels: i32, streams: i32, coupled_streams: i32) -> i32 ---
     

    Gets the size of an <code>OpusProjectionDecoder</code> structure. @param channels <tt>int</tt>: The total number of output channels. This must be no more than 255. @param streams <tt>int</tt>: The total number of streams coded in the input. This must be no more than 255. @param coupled_streams <tt>int</tt>: Number streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of coded channels (<code>streams + coupled_streams</code>) must be no more than 255. @returns The size in bytes on success, or a negative error code (see @ref opus_errorcodes) on error.

    opus_projection_decoder_init ¶

    opus_projection_decoder_init :: proc "c" (
    	st:                   ^OpusProjectionDecoder, 
    	Fs:                   i32, 
    	channels:             i32, 
    	streams:              i32, 
    	coupled_streams:      i32, 
    	demixing_matrix:      [^]u8, 
    	demixing_matrix_size: i32, 
    ) -> i32 ---
     

    Intialize a previously allocated projection decoder state object. The memory pointed to by \a st must be at least the size returned by opus_projection_decoder_get_size(). This is intended for applications which use their own allocator instead of malloc. To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @see opus_projection_decoder_create @see opus_projection_deocder_get_size @param st <tt>OpusProjectionDecoder*</tt>: Projection encoder state to initialize. @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param channels <tt>int</tt>: Number of channels to output. This must be at most 255. It may be different from the number of coded channels (<code>streams + coupled_streams</code>). @param streams <tt>int</tt>: The total number of streams coded in the input. This must be no more than 255. @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled (2 channel) streams. This must be no larger than the total number of streams. Additionally, The total number of coded channels (<code>streams + coupled_streams</code>) must be no more than 255. @param[in] demixing_matrix <tt>const unsigned char[demixing_matrix_size]</tt>: Demixing matrix that mapping from coded channels to output channels, as described in @ref opus_projection and @ref opus_projection_ctls. @param demixing_matrix_size <tt>opus_int32</tt>: The size in bytes of the demixing matrix, as described in @ref opus_projection_ctls. @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes) on failure.

    opus_projection_encode ¶

    opus_projection_encode :: proc "c" (st: ^OpusProjectionEncoder, pcm: [^]i16, frame_size: i32, data: [^]u8, max_data_bytes: i32) -> i32 ---
     

    Encodes a projection Opus frame. @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state. @param[in] pcm <tt>const opus_int16*</tt>: The input signal as interleaved samples. This must contain <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: 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. @param[out] data <tt>unsigned char*</tt>: Output payload. This must contain storage for at least \a max_data_bytes. @param [in] max_data_bytes <tt>opus_int32</tt>: 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.

    opus_projection_encode_float ¶

    opus_projection_encode_float :: proc "c" (st: ^OpusProjectionEncoder, pcm: [^]f32, frame_size: i32, data: [^]u8, max_data_bytes: i32) -> i32 ---
     

    Encodes a projection Opus frame from floating point input. @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state. @param[in] pcm <tt>const float*</tt>: The input signal as interleaved samples 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. This must contain <code>frame_size*channels</code> samples. @param frame_size <tt>int</tt>: 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. @param[out] data <tt>unsigned char*</tt>: Output payload. This must contain storage for at least \a max_data_bytes. @param [in] max_data_bytes <tt>opus_int32</tt>: 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.

    opus_projection_encoder_ctl ¶

    opus_projection_encoder_ctl :: proc "c" (st: ^OpusProjectionEncoder, request: i32, .. args: ..any) -> i32 ---
     

    Perform a CTL function on a projection Opus encoder. * Generally the request and subsequent arguments are generated by a convenience macro. @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state. @param request This and all remaining parameters should be replaced by one of the convenience macros in @ref opus_genericctls, @ref opus_encoderctls, @ref opus_multistream_ctls, or @ref opus_projection_ctls @see opus_genericctls @see opus_encoderctls @see opus_multistream_ctls @see opus_projection_ctls

    opus_projection_encoder_destroy ¶

    opus_projection_encoder_destroy :: proc "c" (st: ^OpusProjectionEncoder) ---
     

    Frees an <code>OpusProjectionEncoder</code> allocated by opus_projection_ambisonics_encoder_create(). @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state to be freed.

    opus_repacketizer_cat ¶

    opus_repacketizer_cat :: proc "c" (rp: ^OpusRepacketizer, data: [^]u8, len: i32) -> i32 ---
     

    Add a packet to the current repacketizer state. * This packet must match the configuration of any packets already submitted * for repacketization since the last call to opus_repacketizer_init(). * This means that it must have the same coding mode, audio bandwidth, frame * size, and channel count. * This can be checked in advance by examining the top 6 bits of the first * byte of the packet, and ensuring they match the top 6 bits of the first * byte of any previously submitted packet. * The total duration of audio in the repacketizer state also must not exceed * 120 ms, the maximum duration of a single packet, after adding this packet. * * The contents of the current repacketizer state can be extracted into new * packets using opus_repacketizer_out() or opus_repacketizer_out_range(). * * In order to add a packet with a different configuration or to add more * audio beyond 120 ms, you must clear the repacketizer state by calling * opus_repacketizer_init(). * If a packet is too large to add to the current repacketizer state, no part * of it is added, even if it contains multiple frames, some of which might * fit. * If you wish to be able to add parts of such packets, you should first use * another repacketizer to split the packet into pieces and add them * individually. * @see opus_repacketizer_out_range * @see opus_repacketizer_out * @see opus_repacketizer_init @param rp <tt>OpusRepacketizer</tt>: The repacketizer state to which to * add the packet. @param[in] data <tt>const unsigned char</tt>: The packet data. * The application must ensure * this pointer remains valid * until the next call to * opus_repacketizer_init() or * opus_repacketizer_destroy(). * @param len <tt>opus_int32</tt>: The number of bytes in the packet data. * @returns An error code indicating whether or not the operation succeeded. * @retval #OPUS_OK The packet's contents have been added to the repacketizer * state. * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence, * the packet's TOC sequence was not compatible * with previously submitted packets (because * the coding mode, audio bandwidth, frame size, * or channel count did not match), or adding * this packet would increase the total amount of * audio stored in the repacketizer state to more * than 120 ms.

    opus_repacketizer_create ¶

    opus_repacketizer_create :: proc "c" () -> ^OpusRepacketizer ---
     

    Allocates memory and initializes the new repacketizer with * opus_repacketizer_init().

    opus_repacketizer_destroy ¶

    opus_repacketizer_destroy :: proc "c" (rp: ^OpusRepacketizer) ---
     

    Frees an <code>OpusRepacketizer</code> allocated by * opus_repacketizer_create(). @param[in] rp <tt>OpusRepacketizer</tt>: State to be freed.

    opus_repacketizer_get_nb_frames ¶

    opus_repacketizer_get_nb_frames :: proc "c" (rp: ^OpusRepacketizer) -> i32 ---
     

    Return the total number of frames contained in packet data submitted to * the repacketizer state so far via opus_repacketizer_cat() since the last * call to opus_repacketizer_init() or opus_repacketizer_create(). * This defines the valid range of packets that can be extracted with * opus_repacketizer_out_range() or opus_repacketizer_out(). @param rp <tt>OpusRepacketizer</tt>: The repacketizer state containing the * frames. * @returns The total number of frames contained in the packet data submitted * to the repacketizer state.

    opus_repacketizer_get_size ¶

    opus_repacketizer_get_size :: proc "c" () -> i32 ---
     

    Gets the size of an <code>OpusRepacketizer</code> structure. * @returns The size in bytes.

    opus_repacketizer_init ¶

    opus_repacketizer_init :: proc "c" (rp: ^OpusRepacketizer) -> ^OpusRepacketizer ---
     

    (Re)initializes a previously allocated repacketizer state. * The state must be at least the size returned by opus_repacketizer_get_size(). * This can be used for applications which use their own allocator instead of * malloc(). * It must also be called to reset the queue of packets waiting to be * repacketized, which is necessary if the maximum packet duration of 120 ms * is reached or if you wish to submit packets with a different Opus * configuration (coding mode, audio bandwidth, frame size, or channel count). * Failure to do so will prevent a new packet from being added with * opus_repacketizer_cat(). * @see opus_repacketizer_create * @see opus_repacketizer_get_size * @see opus_repacketizer_cat @param rp <tt>OpusRepacketizer</tt>: The repacketizer state to * (re)initialize. * @returns A pointer to the same repacketizer state that was passed in.

    opus_repacketizer_out ¶

    opus_repacketizer_out :: proc "c" (rp: ^OpusRepacketizer, data: [^]u8, maxlen: i32) -> i32 ---
     

    Construct a new packet from data previously submitted to the repacketizer * state via opus_repacketizer_cat(). * This is a convenience routine that returns all the data submitted so far * in a single packet. * It is equivalent to calling * @code * opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), * data, maxlen) * @endcode @param rp <tt>OpusRepacketizer</tt>: The repacketizer state from which to * construct the new packet. @param[out] data <tt>const unsigned char</tt>: The buffer in which to * store the output packet. * @param maxlen <tt>opus_int32</tt>: The maximum number of bytes to store in * the output buffer. In order to guarantee * success, this should be at least <code>1277opus_repacketizer_get_nb_frames(rp)</code>. * However, <code>1opus_repacketizer_get_nb_frames(rp)</code> * plus the size of all packet data * submitted to the repacketizer since the * last call to opus_repacketizer_init() or * opus_repacketizer_create() is also * sufficient, and possibly much smaller. * @returns The total size of the output packet on success, or an error code * on failure. * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the * complete output packet.

    opus_repacketizer_out_range ¶

    opus_repacketizer_out_range :: proc "c" (rp: ^OpusRepacketizer, begin: i32, end: i32, data: [^]u8, maxlen: i32) -> i32 ---
     

    Construct a new packet from data previously submitted to the repacketizer * state via opus_repacketizer_cat(). @param rp <tt>OpusRepacketizer</tt>: The repacketizer state from which to * construct the new packet. * @param begin <tt>int</tt>: The index of the first frame in the current * repacketizer state to include in the output. * @param end <tt>int</tt>: One past the index of the last frame in the * current repacketizer state to include in the * output. @param[out] data <tt>const unsigned char</tt>: The buffer in which to * store the output packet. * @param maxlen <tt>opus_int32</tt>: The maximum number of bytes to store in * the output buffer. In order to guarantee * success, this should be at least * <code>1276</code> for a single frame, * or for multiple frames, <code>1277(end-begin)</code>. However, <code>1(end-begin)</code> plus * the size of all packet data submitted to * the repacketizer since the last call to * opus_repacketizer_init() or * opus_repacketizer_create() is also * sufficient, and possibly much smaller. * @returns The total size of the output packet on success, or an error code * on failure. * @retval #OPUS_BAD_ARG <code>[begin,end)</code> was an invalid range of * frames (begin < 0, begin >= end, or end > * opus_repacketizer_get_nb_frames()). * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the * complete output packet.

    opus_strerror ¶

    opus_strerror :: proc "c" (error: i32) -> cstring ---
     

    opus_define.h

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-v0.0.1 (vendor "odin") Linux_amd64 @ 2026-01-30 10:23:18.376332962 +0000 UTC