Class GuildMix
- Namespace
- Nyra
- Assembly
- Nyra.dll
The mix layers of a guild connection.
public sealed class GuildMix
- Inheritance
-
GuildMix
- Inherited Members
Methods
GetLayersAsync(CancellationToken)
Lists the mix layers playing on top of the main track.
public Task<IReadOnlyList<MixLayer>> GetLayersAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<IReadOnlyList<MixLayer>>
The layers playing on the connection.
Exceptions
- NotSupportedException
The node is not NodeLink.
SetVolumeAsync(string, float, CancellationToken)
Changes the loudness of one mix layer, 0.0-1.0.
public Task SetVolumeAsync(string mixLayerId, float volume, CancellationToken cancellationToken = default)
Parameters
mixLayerIdstringThe id of the mix layer.
volumefloatHow loud the layer plays, 0.0-1.0.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task
A task that completes when the layer's volume was set.
Exceptions
- NotSupportedException
The node is not NodeLink.
StartAsync(Track, float?, CancellationToken)
Starts a mix layer, the track plays on top of the main one, server-side, the returned Id changes or stops it later.
public Task<MixLayer> StartAsync(Track track, float? volume = null, CancellationToken cancellationToken = default)
Parameters
trackTrackThe track the layer plays.
volumefloat?How loud the layer plays, 0.0-1.0.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
Remarks
Preconditions the server enforces with a 500 or a 403, the player must have an active stream, the layer count must be under its cap, the mix toggle must be on. A paused or trackless player answers 500, the toggle off answers 403.
Exceptions
- NotSupportedException
The node is not NodeLink.
StopAsync(string, CancellationToken)
Stops one mix layer, the main track keeps playing.
public Task StopAsync(string mixLayerId, CancellationToken cancellationToken = default)
Parameters
mixLayerIdstringThe id of the mix layer to stop.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task
A task that completes when the layer was stopped.
Exceptions
- NotSupportedException
The node is not NodeLink.