Table of Contents

Class RTPReadStream

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

Reads the payload from an RTP frame

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

Constructors

RTPReadStream(AudioStream, int)

public RTPReadStream(AudioStream next, int bufferSize = 4000)

Parameters

next AudioStream
bufferSize int

Properties

CanRead

When overridden in a derived class, gets a value indicating whether the current stream supports reading.

public override bool CanRead { get; }

Property Value

bool

true if the stream supports reading; otherwise, false.

CanSeek

When overridden in a derived class, gets a value indicating whether the current stream supports seeking.

public override bool CanSeek { get; }

Property Value

bool

true if the stream supports seeking; otherwise, false.

CanWrite

When overridden in a derived class, gets a value indicating whether the current stream supports writing.

public override bool CanWrite { get; }

Property Value

bool

true if the stream supports writing; otherwise, false.

Methods

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.

GetHeaderSize(byte[], int)

public static int GetHeaderSize(byte[] buffer, int offset)

Parameters

buffer byte[]
offset int

Returns

int

TryReadSsrc(byte[], int, out uint)

public static bool TryReadSsrc(byte[] buffer, int offset, out uint ssrc)

Parameters

buffer byte[]
offset int
ssrc uint

Returns

bool

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

OperationCanceledException

The token has had cancellation requested.

ObjectDisposedException

The associated CancellationTokenSource has been disposed.