Personalization - Axwabo/SecretLabNAudio GitHub Wiki

Personalization

Use cases include (but are not limited to) setting volume per player preferences, or environment-based loudness.

Note

Settings are tied to Player instances. You have to manage rejoining players yourself.

Settings are cleared when the speaker is pooled

You can access per-player settings by using the indexer: personalization[player]

Add the SpeakerPersonalization component to a SpeakerToy to configure different settings per player.

Add Empty Personalization
using SecretLabNAudio.Core.Extensions;

speaker.AddPersonalization();

speaker.WithPersonalization(personalization => 
{
    // configure
});

The above extension methods can be used on audio players and SpeakerToys.

Methods

Tip

Use SpeakerSettings.From(personalization) with { /* modified properties */} to only change certain properties.

Override

Sets the speaker settings for the given player.

Modify

Modifies the current settings for the given player based on a delegate that transforms settings. The current settings are null if there's no override set for the player.

ClearOverride

Clears the override for the given player and sends the default settings.

⚠️ **GitHub.com Fallback** ⚠️