Class OpusDecodeStream
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
Methods
ClearAsync(CancellationToken)
public override Task ClearAsync(CancellationToken cancelToken)
Parameters
cancelToken
CancellationToken
Returns
Dispose(bool)
Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameters
disposing
booltrue 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.
WriteAsync(byte[], int, int, CancellationToken)
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancelToken)
Parameters
buffer
byte[]offset
intcount
intcancelToken
CancellationToken
Returns
Exceptions
- InvalidOperationException
Received payload without an RTP header.
WriteHeader(ushort, uint, bool)
public override void WriteHeader(ushort seq, uint timestamp, bool missed)
Parameters
Exceptions
- InvalidOperationException
Header received with no payload.