Table of Contents
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

source IExternalOpusSource

The new music source, or null to stop music playback.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task