Table of Contents

Enum OpusControlRequest

Namespace
DSharpPlus.VoiceLink.Opus
Assembly
DSharpPlus.VoiceLink.dll
public enum OpusControlRequest

Fields

Gets the encoder's configured application.

Gets the encoder's configured bandpass or the decoder's last bandpass.

Gets the encoder's bitrate configuration.

Gets the encoder's complexity configuration.

Gets encoder's configured use of discontinuous transmission.

Gets the encoder's configured use of variable duration frames.

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)

Gets the encoder's forced channel configuration.

Gets the decoder's configured gain adjustment.

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.

Gets encoder's configured use of inband forward error correction.

Gets the duration (in samples) of the last packet successfully decoded or concealed.

Gets the total samples of delay added by the entire codec. This can be queried by the encoder and then the provided number of samples can be skipped on from the start of the decoder's output to provide time aligned input and output. From the perspective of a decoding application the real data begins this many samples late. The decoder contribution to this delay is identical for all decoders, but the encoder portion of the delay may vary from implementation to implementation, version to version, or even depend on the encoder's initial configuration. Applications needing delay compensation should call this CTL rather than hard-coding a value.

Gets the encoder's configured signal depth.

Gets the encoder's configured maximum allowed bandpass.

Gets the encoder's configured packet loss percentage.

Gets the encoder's configured phase inversion status.

Gets the pitch of the last decoded frame, if available. This can be used for any post-processing algorithm requiring the use of pitch, e.g. time stretching/shortening. If the last frame was not voiced, or if the pitch was not coded in the frame, then zero is returned.

Gets the encoder's configured prediction status.

Gets the sampling rate the encoder or decoder was initialized with. This simply returns the value passed to Init(OpusSampleRate, int, OpusApplication) or Init(OpusSampleRate, int).

Gets the encoder's configured signal type.

Determine if variable bitrate (VBR) is enabled in the encoder.

Determine if constrained VBR is enabled in the encoder.

Configures the encoder's intended application. The initial value is a mandatory argument to the encoder_create function.

Sets the encoder's bandpass to a specific value. This prevents the encoder from automatically selecting the bandpass based on the available bitrate. If an application knows the bandpass of the input audio it is providing, it should normally use SetMaxBandwidth instead, which still gives the encoder the freedom to reduce the bandpass when the bitrate becomes too low, for better overall quality.

Configures the bitrate in the encoder. Rates from 500 to 512000 bits per second are meaningful, as well as the special values OpusApplication.Auto and OPUS_BITRATE_MAX. The value OPUS_BITRATE_MAX can be used to cause the codec to use as much rate as it can, which is useful for controlling the rate by adjusting the output buffer size.

Configures the encoder's computational complexity. The supported range is 0-10 inclusive with 10 representing the highest complexity.

Configures the encoder's use of discontinuous transmission (DTX).

Configures the encoder's use of variable duration frames. When variable duration is enabled, the encoder is free to use a shorter frame size than the one requested in the Encode(ReadOnlySpan<short>, int, ref Span<byte>) call. It is then the user's responsibility to verify how much audio was encoded by checking the ToC byte of the encoded packet. The part of the audio that was not encoded needs to be resent to the encoder for the next call. Do not use this option unless you really know what you are doing.

Configures mono/stereo forcing in the encoder. This can force the encoder to produce packets encoded as either mono or stereo, regardless of the format of the input audio. This is useful when the caller knows that the input signal is currently a mono source embedded in a stereo stream.

Configures decoder gain adjustment. Scales the decoded output by a factor specified in Q8 dB units. This has a maximum range of -32768 to 32767 inclusive, and returns BadArg otherwise. The default is zero indicating no adjustment. This setting survives decoder reset.

Configures the encoder's use of inband forward error correction (FEC).

Configures the depth of signal being encoded. This is a hint which helps the encoder identify silence and near-silence. It represents the number of significant bits of linear intensity below which the signal contains ignorable quantization or other noise. For example, SetLsbDepth with a value of 14 would be an appropriate setting for G.711 u-law input. SetLsbDepth with a value of 16 would be appropriate for 16-bit linear pcm input with EncodeFloat(ReadOnlySpan<float>, int, ref Span<byte>). When using Encode(ReadOnlySpan<short>, int, ref Span<byte>) instead of EncodeFloat(ReadOnlySpan<float>, int, ref Span<byte>), or when libopus is compiled for fixed-point, the encoder uses the minimum of the value set here and the value 16.

Configures the maximum bandpass that the encoder will select automatically. Applications should normally use this instead of SetBandwidth (leaving that set to the default, OpusApplication.Auto). This allows the application to set an upper bound based on the type of input it is providing, but still gives the encoder the freedom to reduce the bandpass when the bitrate becomes too low, for better overall quality.

Configures the encoder's expected packet loss percentage. Higher values trigger progressively more loss resistant behavior in the encoder at the expense of quality at a given bitrate in the absence of packet loss, but greater quality under loss.

If set to true, 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.

If set to true, disables almost all use of prediction, making frames almost completely independent. This reduces quality.

Configures the type of signal being encoded. This is a hint which helps the encoder's mode selection.

Enables or disables variable bitrate (VBR) in the encoder. The configured bitrate may not be met exactly because frames must be an integer number of bytes in length.

Enables or disables constrained VBR in the encoder. This setting is ignored when the encoder is in CBR mode.