Module veloren_voxygen::audio::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§

  • An AmbienceChannel uses a non-positional audio sink designed to play sounds which are always heard at the camera’s position.
  • An iterator over the variants of AmbienceChannelTag
  • A MusicChannel is designed to play music which is always heard at the player’s position.
  • 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
  • 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§

  • AmbienceChannelTags are used for non-positional sfx. Currently the only use is for wind.
  • 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.