Table of Contents

Class OpusDecodeStream

Namespace
Discord.Audio.Streams
Assembly
Discord.Net.WebSocket.dll

Converts Opus to PCM

public class OpusDecodeStream : AudioOutStream, IAsyncDisposable, IDisposable
Inheritance
OpusDecodeStream
Implements
Inherited Members

Constructors

OpusDecodeStream(AudioStream)

public OpusDecodeStream(AudioStream next)

Parameters

next AudioStream

Fields

SampleRate

public const int SampleRate = 48000

Field Value

int

Methods

ClearAsync(CancellationToken)

public override Task ClearAsync(CancellationToken cancelToken)

Parameters

cancelToken CancellationToken

Returns

Task

Dispose(bool)

Releases the unmanaged resources used by the Stream and optionally releases the managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

FlushAsync(CancellationToken)

Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

public override Task FlushAsync(CancellationToken cancelToken)

Parameters

cancelToken CancellationToken

Returns

Task

A task that represents the asynchronous flush operation.

Exceptions

ObjectDisposedException

The stream has been disposed.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

WriteAsync(byte[], int, int, CancellationToken)

public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancelToken)

Parameters

buffer byte[]
offset int
count int
cancelToken CancellationToken

Returns

Task

Exceptions

InvalidOperationException

Received payload without an RTP header.

WriteHeader(ushort, uint, bool)

public override void WriteHeader(ushort seq, uint timestamp, bool missed)

Parameters

seq ushort
timestamp uint
missed bool

Exceptions

InvalidOperationException

Header received with no payload.