Table of Contents

Class OpusEncodeStream

Namespace
NetCord.Gateway.Voice
Assembly
NetCord.dll
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 Stream

The stream that this stream is writing to.

format PcmFormat

The PCM format to encode from.

channels VoiceChannels

Number of channels in input signal.

application OpusApplication

Opus coding mode.

segment bool

Whether 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

Returns

ValueTask