Class OpusEncodeStream
public class OpusEncodeStream : RewritingStream, IDisposable, IAsyncDisposable
- Inheritance
-
OpusEncodeStream
- Implements
- Inherited Members
Constructors
OpusEncodeStream(Stream, PcmFormat, VoiceChannels, OpusApplication, bool)
public OpusEncodeStream(Stream next, PcmFormat format, VoiceChannels channels, OpusApplication application, bool segment = true)
Parameters
next
StreamThe stream that this stream is writing to.
format
PcmFormatThe PCM format to encode from.
channels
VoiceChannelsNumber of channels in input signal.
application
OpusApplicationOpus coding mode.
segment
boolWhether to segment the written data into Opus frames. You can set this to false if you are sure to write exactly one Opus frame at a time.
Methods
Write(ReadOnlySpan<byte>)
public override void Write(ReadOnlySpan<byte> buffer)
Parameters
buffer
ReadOnlySpan<byte>
WriteAsync(ReadOnlyMemory<byte>, CancellationToken)
public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
Parameters
buffer
ReadOnlyMemory<byte>cancellationToken
CancellationToken