You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, all sound effects and music are managed with the AudioController. AudioController works in the following way:
AudioController Assumptions
Music - Only one music track plays at a time. It either plays once, or loops forever (depending on the loop bool that was set at load time). Starting a different music track would stop the currently playing one suddenly. (Starting the currently running one if it is already playing will do nothing).
Sound Effects - Different sound effects can be played at the same time, but the same sound effect will only have one instance playing at a time. If an instance of a sound effect is called multiple times very quickly, then the sound effect will repeat at minimum after a 0.1 second delay, "interrupting" the previous play of the sound effect until all calls have been played. If the sound effect is currently playing, then nothing will happen and it will continue playing.
(note: currently, music and sound effects cannot be stopped through this interface. Issue here)
Problem
The above are good defaults for quick game making, but there are cases where more elaborate preferences are desired. Consider the following features:
Playing atmospheric ambiences behind music (note: can be done as a looped sound effect)
Music track layering, or atmospheric layering
Crossfading in and out layers
Crossfading out music
Being notified when a music track has finished playing (e.g. ALLEGRO_FLARE_EVENT_MUSIC_TRACK_HAS_STOPPED)
Sync layers to specific time points or audio time markers
Positioned audio sources in 2d or 3d space
Environment filters to sound effects
Starting a "sound effect repeat stream" (for example, when tallying a high score but it needs to stop once the tallying has completed).
Configurable sound effect repeat rate
Variable sound effect speed playback
One "sound effect" plays randomly from a set of n sound effects, not repeating the previously played sound effect, or n-previously played sound effects.
"pausing" music (opening another window) but then resuming it from the same point when returning
lowering current music volume (for example during pause)
Proposed Solution
Basic idea is to create new Jukebox And Soundboard classes, each could be used to handle these more elaborate scenarios. AudioController would remain the same.
The text was updated successfully, but these errors were encountered:
Right now, all sound effects and music are managed with the
AudioController
.AudioController
works in the following way:AudioController
Assumptionsloop
bool that was set at load time). Starting a different music track would stop the currently playing one suddenly. (Starting the currently running one if it is already playing will do nothing).If an instance of a sound effect is called multiple times very quickly, then the sound effect will repeat at minimum after aIf the sound effect is currently playing, then nothing will happen and it will continue playing.0.1
second delay, "interrupting" the previous play of the sound effect until all calls have been played.(note: currently, music and sound effects cannot be stopped through this interface. Issue here)
Problem
The above are good defaults for quick game making, but there are cases where more elaborate preferences are desired. Consider the following features:
ALLEGRO_FLARE_EVENT_MUSIC_TRACK_HAS_STOPPED
)n
sound effects, not repeating the previously played sound effect, or n-previously played sound effects.Proposed Solution
Basic idea is to create new
Jukebox
AndSoundboard
classes, each could be used to handle these more elaborate scenarios.AudioController
would remain the same.The text was updated successfully, but these errors were encountered: