opus_defines.h(3)
πΈ NAME πΈ
okay so this is the opus_defines.h(3) manual page, and it's literally just the Opus reference implementation constants π
like, all the little #defines and the two functions that go with them. that's the whole vibe. no cap.
β¨ SYNOPSIS β¨
bestie you get there like this:
#include 'opus_types.h'
and then everything below is just macros and functions chilling in there. let's go π¦
Macros
these are the error codes first, and honestly they're giving "things that can go wrong" energy:
OPUS_OKβ no error. we love her. β¨OPUS_BAD_ARGβ one or more invalid/out of range arguments. rude of you tbh.OPUS_BUFFER_TOO_SMALLβ not enough bytes allocated in the buffer. she needs more room πOPUS_INTERNAL_ERRORβ an internal error was detected. something inside is Not Okay.OPUS_INVALID_PACKETβ the compressed data passed is corrupted. πOPUS_UNIMPLEMENTEDβ invalid/unsupported request number. we don't do that here.OPUS_INVALID_STATEβ an encoder or decoder structure is invalid or already freed. bestie she's gone, let her rest πOPUS_ALLOC_FAILβ memory allocation has failed. the RAM said no.
then the settings-y ones:
OPUS_AUTOβ auto/default setting. the "you pick, i trust you" option π«ΆOPUS_BITRATE_MAXβ maximum bitrate. all the bits. every last one π₯
the applications (aka "what are you even doing with this encoder"):
OPUS_APPLICATION_VOIPβ best for most VoIP/videoconference applications where listening quality and intelligibility matter most. like, you need to actually hear your friend.OPUS_APPLICATION_AUDIOβ best for broadcast/high-fidelity application where the decoded audio should be as close as possible to the input. the audiophile icon πOPUS_APPLICATION_RESTRICTED_LOWDELAYβ only use when lowest-achievable latency is what matters most. speed. speed. speed.OPUS_APPLICATION_RESTRICTED_SILK(2052) β experts only: forces SILK encoding; don't allocate CELT state at all. like, do not try this if you don't know what you're doing, fr fr.OPUS_APPLICATION_RESTRICTED_CELT(2053) β experts only: forces CELT encoding; don't allocate SILK state at all. same warning, opposite girlie.
signal types:
OPUS_SIGNAL_VOICE(3001) β signal being encoded is voice. talking. yapping. π£οΈOPUS_SIGNAL_MUSIC(3002) β signal being encoded is music. the vibes π
bandwidths, aka how wide is the band bestie:
OPUS_BANDWIDTH_NARROWBANDβ4 kHzbandpassOPUS_BANDWIDTH_MEDIUMBANDβ6 kHzbandpassOPUS_BANDWIDTH_WIDEBANDβ8 kHzbandpassOPUS_BANDWIDTH_SUPERWIDEBANDβ12 kHzbandpassOPUS_BANDWIDTH_FULLBANDβ20 kHzbandpass π
frame sizes, from tiny to not-so-tiny:
OPUS_FRAMESIZE_ARG(5000) β select frame size from the argument (default).OPUS_FRAMESIZE_2_5_MS(5001) β use2.5 msframes.OPUS_FRAMESIZE_5_MS(5002) β use5 msframes.OPUS_FRAMESIZE_10_MS(5003) β use10 msframes.OPUS_FRAMESIZE_20_MS(5004) β use20 msframes.OPUS_FRAMESIZE_40_MS(5005) β use40 msframes.OPUS_FRAMESIZE_60_MS(5006) β use60 msframes.OPUS_FRAMESIZE_80_MS(5007) β use80 msframes.OPUS_FRAMESIZE_100_MS(5008) β use100 msframes.OPUS_FRAMESIZE_120_MS(5009) β use120 msframes.
and now the actual getters and setters, the main character section:
OPUS_SET_COMPLEXITY(x)β configures the encoder's computational complexity.OPUS_GET_COMPLEXITY(x)β gets the encoder's complexity configuration.OPUS_SET_BITRATE(x)β configures the bitrate in the encoder.OPUS_GET_BITRATE(x)β gets the encoder's bitrate configuration.OPUS_SET_VBR(x)β enables or disables variable bitrate (VBR) in the encoder.OPUS_GET_VBR(x)β determine if variable bitrate (VBR) is enabled in the encoder.OPUS_SET_VBR_CONSTRAINT(x)β enables or disables constrained VBR in the encoder.OPUS_GET_VBR_CONSTRAINT(x)β determine if constrained VBR is enabled in the encoder.OPUS_SET_FORCE_CHANNELS(x)β configures mono/stereo forcing in the encoder.OPUS_GET_FORCE_CHANNELS(x)β gets the encoder's forced channel configuration.OPUS_SET_MAX_BANDWIDTH(x)β configures the maximum bandpass that the encoder will select automatically.OPUS_GET_MAX_BANDWIDTH(x)β gets the encoder's configured maximum allowed bandpass.OPUS_SET_BANDWIDTH(x)β sets the encoder's bandpass to a specific value.OPUS_SET_SIGNAL(x)β configures the type of signal being encoded.OPUS_GET_SIGNAL(x)β gets the encoder's configured signal type.OPUS_SET_APPLICATION(x)β configures the encoder's intended application.OPUS_GET_APPLICATION(x)β gets the encoder's configured application.OPUS_GET_LOOKAHEAD(x)β gets the total samples of delay added by the entire codec.OPUS_SET_INBAND_FEC(x)β configures the encoder's use of inband forward error correction (FEC).OPUS_GET_INBAND_FEC(x)β gets encoder's configured use of inband forward error correction.OPUS_SET_PACKET_LOSS_PERC(x)β configures the encoder's expected packet loss percentage.OPUS_GET_PACKET_LOSS_PERC(x)β gets the encoder's configured packet loss percentage.OPUS_SET_DTX(x)β configures the encoder's use of discontinuous transmission (DTX).OPUS_GET_DTX(x)β gets encoder's configured use of discontinuous transmission.OPUS_SET_LSB_DEPTH(x)β configures the depth of signal being encoded.OPUS_GET_LSB_DEPTH(x)β gets the encoder's configured signal depth.OPUS_SET_EXPERT_FRAME_DURATION(x)β configures the encoder's use of variable duration frames.OPUS_GET_EXPERT_FRAME_DURATION(x)β gets the encoder's configured use of variable duration frames.OPUS_SET_PREDICTION_DISABLED(x)β if set to1, disables almost all use of prediction, making frames almost completely independent.OPUS_GET_PREDICTION_DISABLED(x)β gets the encoder's configured prediction status.OPUS_SET_DRED_DURATION(x)β if non-zero, enables Deep Redundancy (DRED) and use the specified maximum number of10-msredundant frames.OPUS_GET_DRED_DURATION(x)β gets the encoder's configured Deep Redundancy (DRED) maximum number of frames.OPUS_SET_DNN_BLOB(data, len)β provide external DNN weights from binary object (only when explicitly built without the weights).OPUS_SET_QEXT(x)β if set to1, enables quality extension (QEXT), otherwise disables it (default).OPUS_GET_QEXT(x)β gets the encoder's configured quality extension (QEXT).OPUS_RESET_STATEβ resets the codec state to be equivalent to a freshly initialized state. she's reborn β¨OPUS_GET_FINAL_RANGE(x)β gets the final state of the codec's entropy coder.OPUS_GET_BANDWIDTH(x)β gets the encoder's configured bandpass or the decoder's last bandpass.OPUS_GET_SAMPLE_RATE(x)β gets the sampling rate the encoder or decoder was initialized with.OPUS_SET_PHASE_INVERSION_DISABLED(x)β if set to1, disables the use of phase inversion for intensity stereo, improving the quality of mono downmixes, but slightly reducing normal stereo quality.OPUS_GET_PHASE_INVERSION_DISABLED(x)β gets the encoder's configured phase inversion status.OPUS_GET_IN_DTX(x)β gets the DTX state of the encoder.OPUS_SET_GAIN(x)β configures decoder gain adjustment.OPUS_GET_GAIN(x)β gets the decoder's configured gain adjustment.OPUS_GET_LAST_PACKET_DURATION(x)β gets the duration (in samples) of the last packet successfully decoded or concealed.OPUS_GET_PITCH(x)β gets the pitch of the last decoded frame, if available.OPUS_SET_OSCE_BWE(x)β enables blind bandwidth extension for wideband signals if decoding sampling rate is48 kHz.OPUS_GET_OSCE_BWE(x)β gets blind bandwidth extension flag for wideband signals if decoding sampling rate is48 kHz.OPUS_SET_IGNORE_EXTENSIONS(x)β if set to1, the decoder will ignore all extensions found in the padding area (does not affect DRED, which is decoded separately).OPUS_GET_IGNORE_EXTENSIONS(x)β gets whether the decoder is ignoring extensions.
Functions
only two besties, and they're both little helpers:
const char * opus_strerror (int error)β converts an opus error code into a human readable string. so you can finally know what went wrong πconst char * opus_get_version_string (void)β gets the libopus version string. hi what version are you π
π Detailed Description π
Opus reference implementation constants.
that's it. that's the description. iconic brevity honestly.
π«Ά Author π«Ά
Generated automatically by Doxygen for Opus from the source code. (yes, a robot wrote it, and it ate π )
okay bestie that's the whole page!! Version 1.6.1, Thu Jan 29 2026 14:35:32 β that's the version and the date, mwah, love you, go encode something beautiful πΈβ¨π¦
π¦ 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