this post was submitted on 19 Aug 2026
6 points (100.0% liked)

Gamedev

527 readers
6 users here now

https://lemmy.world/c/Gamedev A Lemmy community to share game development news and info!

founded 3 years ago
MODERATORS
 

Does anyone have good tips/tricks to handle Sound Effects in game?

Adding million "play sound effect X" lines all over the code seems wrong, but cannot think another solution. There are so many different places and event that need sound effects so some kind of general solution does seem viable.

I would love to hear your solutions or how you handle the audio in your games!

top 3 comments
sorted by: hot top controversial new old
[–] Shin@piefed.social 2 points 1 day ago

In my humble experience what solved (considering the engine), I've a singleton for the audio, I call from this to request any SFX, it will make all the spawning of the objects that I need for the audio, clean up and such. Additionally, it allows me to add some variation on the sound (pitch, tempo, speed, volume...), so I can be as precise I need for some SFX, while leave randomness for others.

[–] Wawe@lemmy.world 3 points 5 days ago (1 children)

I asked some question in Mastodon and someone suggested using event instead of direct audio calls so I think I will go with that!

[–] bjoern_tantau@swg-empire.de 2 points 4 days ago

Don't forget to tag them all somehow so that you can offer volume adjustments.