Table of Contents

Struct OpusDecoder

Namespace
NetCord.Gateway.Voice
Assembly
NetCord.dll
public readonly struct OpusDecoder : IDisposable
Implements
Inherited Members

Constructors

OpusDecoder(VoiceChannels)

public OpusDecoder(VoiceChannels channels)

Parameters

channels VoiceChannels

Number of channels to decode.

Methods

Decode(ReadOnlySpan<byte>, Span<byte>, int, bool)

Decodes an Opus frame.

public int Decode(ReadOnlySpan<byte> data, Span<byte> pcm, int frameSize, bool decodeFec)

Parameters

data ReadOnlySpan<byte>

Input payload. Use null to indicate packet loss.

pcm Span<byte>

Output signal.

frameSize int

Number of samples per channel in the output signal.

decodeFec bool

Whether to decode using forward error correction data, if available.

Returns

int

The number of decoded samples per channel.

Decode(ReadOnlySpan<byte>, Span<short>, int, bool)

Decodes an Opus frame.

public int Decode(ReadOnlySpan<byte> data, Span<short> pcm, int frameSize, bool decodeFec)

Parameters

data ReadOnlySpan<byte>

Input payload. Use null to indicate packet loss.

pcm Span<short>

Output signal.

frameSize int

Number of samples per channel in the output signal.

decodeFec bool

Whether to decode using forward error correction data, if available.

Returns

int

The number of decoded samples per channel.

DecodeFloat(ReadOnlySpan<byte>, Span<byte>, int, bool)

Decodes an Opus frame.

public int DecodeFloat(ReadOnlySpan<byte> data, Span<byte> pcm, int frameSize, bool decodeFec)

Parameters

data ReadOnlySpan<byte>

Input payload. Use null to indicate packet loss.

pcm Span<byte>

Output signal.

frameSize int

Number of samples per channel in the output signal.

decodeFec bool

Whether to decode using forward error correction data, if available.

Returns

int

The number of decoded samples per channel.

DecodeFloat(ReadOnlySpan<byte>, Span<float>, int, bool)

Decodes an Opus frame.

public int DecodeFloat(ReadOnlySpan<byte> data, Span<float> pcm, int frameSize, bool decodeFec)

Parameters

data ReadOnlySpan<byte>

Input payload. Use null to indicate packet loss.

pcm Span<float>

Output signal.

frameSize int

Number of samples per channel in the output signal.

decodeFec bool

Whether to decode using forward error correction data, if available.

Returns

int

The number of decoded samples per channel.

Dispose()

public void Dispose()