Skip to content

Audio Manager

NebSeniah edited this page Jun 10, 2026 · 9 revisions

System Summary

The Audio Manager controls all audio being played, with the music and sound effects separated into two different functionalities. Audio and be run from the UI, in which case the existence of files should be guaranteed, it can also be run from the folder LevelSmithLabs/Audio in the user's roaming appdata. The Manager also handles fallback if said files do not currently exist.


Connected Systems

Connecting Systems:

Related Controls

Key(s): M

  • A temporary control for the audio, it's muted by default and M can be pressed to unmute/mute it.

Bugs

  • None

Feature List / Breakdown of Features

Audio:

  • User can place appropriately named audio files into the Audio folder to play custom sound effects/music during testing
  • If files don't exist, fallback is handled with default sound effects during gameplay
  • Basic sound effects play during editing (To be added)

All audio files that can be added by the user: PlayerDeath, PlayerJump, Victory, EnemyDeath, LevelMusic


Important Variables

available_players: Array[AudioStreamPlayer] = All AudioStreamPlayers not currently playing audio, new sound effects can be run in these. inuse_players: Array[AudioStreamPlayer] = All AudioStreamPlayers that are currently playing audio, these are stored so volume changes impact currently played effects. queue: Array[String] = An array of filepaths with audio to play, can be .mp4 or .wav.

Important Functions

func play_(UI_)effect(effectName: String) -> void: Plays a sound effect or UI effect, sound effects get routed through the currently created Audio folder in the user's Roaming directory, UI sound effects are stored in the project. This function adds the effect to the queue to play during the next process frame a player is available. **func play(UI_)music(musicName: String) -> void**: Stops the currently played music being held by musicPlayer, starts music at the specified filepath. Filepath handling works the same as play_(UI_)effect.


Future Work / Risks

Future Work:

  1. Adding in the proper sound effects and music for building and testing, everything right now is temporary.
  2. Moving the read audio into the level's folder inside LevelSmith_Labs folder.

Risks:

  • If the user puts in a file that's not .mp3 or .wav, it won't work.

Miscellaneous Notes

  • None

Clone this wiki locally