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
sourceStreamThe source Stream
destinationVoiceTransmitSinkThe target VoiceTransmitSink
bufferSizeint?The size, in bytes, of the buffer. This value must be greater than zero. If null, defaults to the packet size specified by
destination.cancellationTokenCancellationTokenThe token to monitor for cancellation requests.