---
name: "opus_defines.h"
section: "3"
platform: "linux"
package: "libopus-doc"
version: "1.5.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/opus_defines.h"
---

# opus\_defines.h(3)

Opus reference implementation constants.

## NAME

opus\_defines.h - Opus reference implementation constants.

## SYNOPSIS

`#include 'opus_types.h'`\

### Macros

\#define **OPUS\_OK**\
 No error.  #define **OPUS\_BAD\_ARG**\
 One or more invalid/out of range arguments.  #define **OPUS\_BUFFER\_TOO\_SMALL**\
 Not enough bytes allocated in the buffer.  #define **OPUS\_INTERNAL\_ERROR**\
 An internal error was detected.  #define **OPUS\_INVALID\_PACKET**\
 The compressed data passed is corrupted.  #define **OPUS\_UNIMPLEMENTED**\
 Invalid/unsupported request number.  #define **OPUS\_INVALID\_STATE**\
 An encoder or decoder structure is invalid or already freed.  #define **OPUS\_ALLOC\_FAIL**\
 Memory allocation has failed.  #define **OPUS\_AUTO**\
 Auto/default setting.  #define **OPUS\_BITRATE\_MAX**\
 Maximum bitrate.  #define **OPUS\_APPLICATION\_VOIP**\
 Best for most VoIP/videoconference applications where listening quality and intelligibility matter most.  #define **OPUS\_APPLICATION\_AUDIO**\
 Best for broadcast/high-fidelity application where the decoded audio should be as close as possible to the input.  #define **OPUS\_APPLICATION\_RESTRICTED\_LOWDELAY**\
 Only use when lowest-achievable latency is what matters most.  #define **OPUS\_SIGNAL\_VOICE**   3001\
 Signal being encoded is voice.  #define **OPUS\_SIGNAL\_MUSIC**   3002\
 Signal being encoded is music.  #define **OPUS\_BANDWIDTH\_NARROWBAND**\
 4 kHz bandpass  #define **OPUS\_BANDWIDTH\_MEDIUMBAND**\
 6 kHz bandpass  #define **OPUS\_BANDWIDTH\_WIDEBAND**\
 8 kHz bandpass  #define **OPUS\_BANDWIDTH\_SUPERWIDEBAND**\
 12 kHz bandpass  #define **OPUS\_BANDWIDTH\_FULLBAND**\
 20 kHz bandpass  #define **OPUS\_FRAMESIZE\_ARG**   5000\
 Select frame size from the argument (default)  #define **OPUS\_FRAMESIZE\_2\_5\_MS**   5001\
 Use 2.5 ms frames.  #define **OPUS\_FRAMESIZE\_5\_MS**   5002\
 Use 5 ms frames.  #define **OPUS\_FRAMESIZE\_10\_MS**   5003\
 Use 10 ms frames.  #define **OPUS\_FRAMESIZE\_20\_MS**   5004\
 Use 20 ms frames.  #define **OPUS\_FRAMESIZE\_40\_MS**   5005\
 Use 40 ms frames.  #define **OPUS\_FRAMESIZE\_60\_MS**   5006\
 Use 60 ms frames.  #define **OPUS\_FRAMESIZE\_80\_MS**   5007\
 Use 80 ms frames.  #define **OPUS\_FRAMESIZE\_100\_MS**   5008\
 Use 100 ms frames.  #define **OPUS\_FRAMESIZE\_120\_MS**   5009\
 Use 120 ms frames.  #define **OPUS\_SET\_COMPLEXITY**(x)\
 Configures the encoder's computational complexity.  #define **OPUS\_GET\_COMPLEXITY**(x)\
 Gets the encoder's complexity configuration.  #define **OPUS\_SET\_BITRATE**(x)\
 Configures the bitrate in the encoder.  #define **OPUS\_GET\_BITRATE**(x)\
 Gets the encoder's bitrate configuration.  #define **OPUS\_SET\_VBR**(x)\
 Enables or disables variable bitrate (VBR) in the encoder.  #define **OPUS\_GET\_VBR**(x)\
 Determine if variable bitrate (VBR) is enabled in the encoder.  #define **OPUS\_SET\_VBR\_CONSTRAINT**(x)\
 Enables or disables constrained VBR in the encoder.  #define **OPUS\_GET\_VBR\_CONSTRAINT**(x)\
 Determine if constrained VBR is enabled in the encoder.  #define **OPUS\_SET\_FORCE\_CHANNELS**(x)\
 Configures mono/stereo forcing in the encoder.  #define **OPUS\_GET\_FORCE\_CHANNELS**(x)\
 Gets the encoder's forced channel configuration.  #define **OPUS\_SET\_MAX\_BANDWIDTH**(x)\
 Configures the maximum bandpass that the encoder will select automatically.  #define **OPUS\_GET\_MAX\_BANDWIDTH**(x)\
 Gets the encoder's configured maximum allowed bandpass.  #define **OPUS\_SET\_BANDWIDTH**(x)\
 Sets the encoder's bandpass to a specific value.  #define **OPUS\_SET\_SIGNAL**(x)\
 Configures the type of signal being encoded.  #define **OPUS\_GET\_SIGNAL**(x)\
 Gets the encoder's configured signal type.  #define **OPUS\_SET\_APPLICATION**(x)\
 Configures the encoder's intended application.  #define **OPUS\_GET\_APPLICATION**(x)\
 Gets the encoder's configured application.  #define **OPUS\_GET\_LOOKAHEAD**(x)\
 Gets the total samples of delay added by the entire codec.  #define **OPUS\_SET\_INBAND\_FEC**(x)\
 Configures the encoder's use of inband forward error correction (FEC).  #define **OPUS\_GET\_INBAND\_FEC**(x)\
 Gets encoder's configured use of inband forward error correction.  #define **OPUS\_SET\_PACKET\_LOSS\_PERC**(x)\
 Configures the encoder's expected packet loss percentage.  #define **OPUS\_GET\_PACKET\_LOSS\_PERC**(x)\
 Gets the encoder's configured packet loss percentage.  #define **OPUS\_SET\_DTX**(x)\
 Configures the encoder's use of discontinuous transmission (DTX).  #define **OPUS\_GET\_DTX**(x)\
 Gets encoder's configured use of discontinuous transmission.  #define **OPUS\_SET\_LSB\_DEPTH**(x)\
 Configures the depth of signal being encoded.  #define **OPUS\_GET\_LSB\_DEPTH**(x)\
 Gets the encoder's configured signal depth.  #define **OPUS\_SET\_EXPERT\_FRAME\_DURATION**(x)\
 Configures the encoder's use of variable duration frames.  #define **OPUS\_GET\_EXPERT\_FRAME\_DURATION**(x)\
 Gets the encoder's configured use of variable duration frames.  #define **OPUS\_SET\_PREDICTION\_DISABLED**(x)\
 If set to 1, disables almost all use of prediction, making frames almost completely independent.  #define **OPUS\_GET\_PREDICTION\_DISABLED**(x)\
 Gets the encoder's configured prediction status.  #define **OPUS\_SET\_DRED\_DURATION**(x)\
 If non-zero, enables Deep Redundancy (DRED) and use the specified maximum number of 10-ms redundant frames.  #define **OPUS\_GET\_DRED\_DURATION**(x)\
 Gets the encoder's configured Deep Redundancy (DRED) maximum number of frames.  #define **OPUS\_SET\_DNN\_BLOB**(data,  len)\
 Provide external DNN weights from binary object (only when explicitly built without the weights)  #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.  #define **OPUS\_SET\_GAIN**(x)\
 Configures decoder gain adjustment.  #define **OPUS\_GET\_GAIN**(x)\
 Gets the decoder's configured gain adjustment.  #define **OPUS\_GET\_LAST\_PACKET\_DURATION**(x)\
 Gets the duration (in samples) of the last packet successfully decoded or concealed.  #define **OPUS\_GET\_PITCH**(x)\
 Gets the pitch of the last decoded frame, if available.

### Functions

const char \* **opus\_strerror** (int error)\
 Converts an opus error code into a human readable string.  const char \* **opus\_get\_version\_string** (void)\
 Gets the libopus version string.

## Detailed Description

Opus reference implementation constants.

## Author

Generated automatically by Doxygen for Opus from the source code.
