Module channel

Source
Expand description

Distinct audio playback channels for music and sound effects

Voxygen’s audio system uses a limited number of channels to play multiple sounds simultaneously. Each additional channel used decreases performance in-game, so the amount of channels utilized should be kept to a minimum.

When constructing a new AudioFrontend, the number of sfx channels are determined by the num_sfx_channels value defined in the client AudioSettings

Structs§

AmbienceChannel
An AmbienceChannel uses a non-positional audio sink designed to play sounds which are always heard at the camera’s position.
AmbienceChannelTagIter
An iterator over the variants of AmbienceChannelTag
MusicChannel
A MusicChannel is designed to play music which is always heard at the player’s position.
SfxChannel
An SfxChannel uses a positional audio sink, and is designed for short-lived audio which can be spatially controlled, but does not need control over playback or fading/transitions
UiChannel
An UiChannel uses a non-spatial audio sink, and is designed for short-lived audio which is not spatially controlled, but does not need control over playback or fading/transitions

Enums§

AmbienceChannelTag
AmbienceChannelTags are used for non-positional sfx. Currently the only use is for wind.
LoopPoint
MusicChannelTag
Each MusicChannel has a MusicChannelTag which help us determine when we should transition between two types of in-game music. For example, we transition between TitleMusic and Exploration when a player enters the world by crossfading over a slow duration. In the future, transitions in the world such as Exploration -> BossBattle would transition more rapidly.
UiChannelTag

Constants§

SFX_DIST_LIMIT
We watch the states of nearby entities in order to emit SFX at their position based on their state. This constant limits the radius that we observe to prevent tracking distant entities. It approximates the distance at which the volume of the sfx emitted is too quiet to be meaningful for the player.
SFX_DIST_LIMIT_SQR