opus_genericctls(3)
π opus_genericctls β the generic CTLs page (Opus, section 3) π
okay bestie, pull up a chair, because this one is genuinely iconic. we're in section 3 of the Opus manual, and this page is all about the generic CTLs. π
β¨ NAME β¨
opus_genericctls β Generic CTLs.
These macros are used with the opus_decoder_ctl and opus_encoder_ctl calls to generate a particular request. that's the whole vibe. π«Ά
πΈ SYNOPSIS πΈ
Macros π§
#define OPUS_RESET_STATEβ Resets the codec state to be equivalent to a freshly initialized state.#define OPUS_GET_FINAL_RANGE(x)β Gets the final state of the codec's entropy coder.#define OPUS_GET_BANDWIDTH(x)β Gets the encoder's configured bandpass or the decoder's last bandpass.#define OPUS_GET_SAMPLE_RATE(x)β Gets the sampling rate the encoder or decoder was initialized with.#define OPUS_SET_PHASE_INVERSION_DISABLED(x)β If set to 1, disables the use of phase inversion for intensity stereo, improving the quality of mono downmixes, but slightly reducing normal stereo quality.#define OPUS_GET_PHASE_INVERSION_DISABLED(x)β Gets the encoder's configured phase inversion status.#define OPUS_GET_IN_DTX(x)β Gets the DTX state of the encoder.
π Detailed Description π
These macros are used with the opus_decoder_ctl and opus_encoder_ctl calls to generate a particular request. fr fr, that's the entire point of them. β¨
When called on an OpusDecoder they apply to that particular decoder instance. When called on an OpusEncoder they apply to the corresponding setting on that encoder instance, if present.
Some usage examples:
int ret;
opus_int32 pitch;
ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch));
if (ret == OPUS_OK) return ret;
opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE);
opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE);
opus_int32 enc_bw, dec_bw;
opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw));
opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw));
if (enc_bw != dec_bw) {
printf("packet bandwidth mismatch!\n");
}
π See also π
Opus Encoder, opus_decoder_ctl, opus_encoder_ctl, Decoder related CTLs, Encoder related CTLs.
π Macro Definition Documentation π
#define OPUS_GET_BANDWIDTH( x) π¦
Gets the encoder's configured bandpass or the decoder's last bandpass.
See also
OPUS_SET_BANDWIDTH
Parameters
xopus_int32 *: Returns one of the following values:OPUS_AUTO- (default)
OPUS_BANDWIDTH_NARROWBAND- 4 kHz passband
OPUS_BANDWIDTH_MEDIUMBAND- 6 kHz passband
OPUS_BANDWIDTH_WIDEBAND- 8 kHz passband
OPUS_BANDWIDTH_SUPERWIDEBAND- 12 kHz passband
OPUS_BANDWIDTH_FULLBAND- 20 kHz passband
#define OPUS_GET_FINAL_RANGE( x) π₯
Gets the final state of the codec's entropy coder. This is used for testing purposes. The encoder and decoder state should be identical after coding a payload (assuming no data corruption or software bugs). no cap, they gotta match. π€
Parameters
xopus_uint32 *: Entropy coder state
#define OPUS_GET_IN_DTX( x) π
Gets the DTX state of the encoder. Returns whether the last encoded frame was either a comfort noise update during DTX or not encoded because of DTX.
Parameters
xopus_int32 *: Returns one of the following values:0- The encoder is not in DTX.
1- The encoder is in DTX.
#define OPUS_GET_PHASE_INVERSION_DISABLED( x) π
Gets the encoder's configured phase inversion status.
See also
OPUS_SET_PHASE_INVERSION_DISABLED
Parameters
xopus_int32 *: Returns one of the following values:0- Stereo phase inversion enabled (default).
1- Stereo phase inversion disabled.
#define OPUS_GET_SAMPLE_RATE( x) β
Gets the sampling rate the encoder or decoder was initialized with. This simply returns the Fs value passed to opus_encoder_init() or opus_decoder_init().
Parameters
xopus_int32 *: Sampling rate of encoder or decoder.
#define OPUS_RESET_STATE π
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.
bestie this one is important, don't skip it when you're hopping between streams π
#define OPUS_SET_PHASE_INVERSION_DISABLED( x) π
If set to 1, disables the use of phase inversion for intensity stereo, improving the quality of mono downmixes, but slightly reducing normal stereo quality. Disabling phase inversion in the decoder does not comply with RFC 6716, although it does not cause any interoperability issue and is expected to become part of the Opus standard once RFC 6716 is updated by draft-ietf-codec-opus-update.
okay so lowkey this one is a whole situation: disabling phase inversion in the decoder does not comply with RFC 6716. it's not gonna break interop, and it's expected to become part of the Opus standard once RFC 6716 gets updated by draft-ietf-codec-opus-update. but yeah. heads up. π
See also
OPUS_GET_PHASE_INVERSION_DISABLED
Parameters
xopus_int32: Allowed values:0- Enable phase inversion (default).
1- Disable phase inversion.
π Author π
Generated automatically by Doxygen for Opus from the source code. (not a human, just a little documentation goblin doing its thing π§)
that's the whole page bestie, you ate it. π
this was Version 1.6.1, dated Thu Jan 29 2026 14:35:32, and it's the opus_genericctls(3) page β go forth and ctl things, main character. π«Άβ¨
π¦ where this page comes from
- ubuntu resolute: libopus-doc 1.6.1-1 Β· BSD-3-Clause
- ubuntu stonking: libopus-doc 1.6.1-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms