API reference
Method SetMusicSourceAsync
- Namespace
- DisCatSharp.Voice.Entities
- Assembly
- DisCatSharp.Voice.dll
SetMusicSourceAsync(IExternalOpusSource?, CancellationToken)
Binds the main music source. Rebinding cleanly stops the prior source pump. The music source is expected to produce Opus frames and is forwarded directly when possible.
public Task SetMusicSourceAsync(IExternalOpusSource? source, CancellationToken cancellationToken = default)
Parameters
sourceIExternalOpusSourceThe new music source, or null to stop music playback.
cancellationTokenCancellationTokenA token to cancel the operation.