Skip to content

SendEngine

Axwabo edited this page Sep 3, 2025 · 2 revisions

SendEngine

The SendEngine is a base class for broadcasting AudioMessages.

An AudioMessage contains encoded Opus data, it shouldn't be modified.

SendEngine.Default broadcasts messages to everyone.

Tip

See also: AudioPlayer

Two methods exist in this class, both can be overridden:

  • void Broadcast(AudioMessage) - sending behavior, loops through all ready players by default
  • bool Broadcast(Player, AudioMessage) - indicates whether the message was sent to the player

Implementations

FilteredSendEngine

Sends audio to players matching a predicate.

Tip

Use the WithFilteredSendEngine extension method on the AudioPlayer for shorter code.

SpecificPlayerSendEngine

Important

Consider your use case before sending to one player. If you want to send the same output to potentially multiple players, use the FilteredSendEngine

Sends audio to one specific player.

This class is more performant than FilteredSendEngine because it overrides void Broadcast(AudioMessage) to send to the target only.

LivePersonalizedSendEngine

This class requires a SpeakerPersonalization instance.

When sending audio messages, the personalization's Modify method is called for each player based on a function that transforms settings.

This allows for creating audio based on the environment (e.g. a beep that remains audible at a low volume after some distance).

A base engine can be provided, which will determine whether to transform settings (e.g. FilteredSendEngine).

Tip

Use SpeakerSettings.From(personalization) to obtain current settings if transforming null (no override).

PersonalizedSendEngineBase

This is the base class of LivePersonalizedSendEngine which allows the implementation to override the personalization method.

VoiceMessageSendEngine

Given a Player instance, broadcasts the AudioMessages as VoiceMessages as if the source player was speaking. Use the RoundSummary voice channel for the source to be audible at all times.

Clone this wiki locally