Table of Contents

Class OpusEncoder

Namespace
NetCord.Gateway.Voice
Assembly
NetCord.dll
public sealed class OpusEncoder : IDisposable
Inheritance
OpusEncoder
Implements
Inherited Members

Constructors

OpusEncoder(VoiceChannels, OpusApplication)

public OpusEncoder(VoiceChannels channels, OpusApplication application)

Parameters

channels VoiceChannels

Number of channels in input signal.

application OpusApplication

Opus coding mode.

Exceptions

OpusException

Methods

Dispose()

public void Dispose()

Encode(ReadOnlySpan<byte>, Span<byte>)

Encodes an Opus frame.

public int Encode(ReadOnlySpan<byte> pcm, Span<byte> data)

Parameters

pcm ReadOnlySpan<byte>

Input signal.

data Span<byte>

Output payload.

Returns

int

The length of the encoded packet.

Exceptions

OpusException

EncodeFloat(ReadOnlySpan<byte>, Span<byte>)

Encodes an Opus frame.

public int EncodeFloat(ReadOnlySpan<byte> pcm, Span<byte> data)

Parameters

pcm ReadOnlySpan<byte>

Input signal.

data Span<byte>

Output payload.

Returns

int

The length of the encoded packet.

Exceptions

OpusException