Table of Contents

Method CopyToAsync

Namespace
DSharpPlus.VoiceNext
Assembly
DSharpPlus.VoiceNext.dll

CopyToAsync(Stream, VoiceTransmitSink, int?, CancellationToken)

Asynchronously reads the bytes from the current stream and writes them to the specified VoiceTransmitSink.

public static Task CopyToAsync(this Stream source, VoiceTransmitSink destination, int? bufferSize = null, CancellationToken cancellationToken = default)

Parameters

source Stream

The source Stream

destination VoiceTransmitSink

The target VoiceTransmitSink

bufferSize int?

The size, in bytes, of the buffer. This value must be greater than zero. If null, defaults to the packet size specified by destination.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task