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
nextStreamThe stream that this stream is writing to.
formatPcmFormatThe PCM format to encode from.
channelsVoiceChannelsNumber of channels in input signal.
applicationOpusApplicationOpus coding mode.
segmentboolWhether 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
bufferReadOnlySpan<byte>
WriteAsync(ReadOnlyMemory<byte>, CancellationToken)
public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
Parameters
bufferReadOnlyMemory<byte>cancellationTokenCancellationToken