Audio overlapping solution

Hey,

I wrote my own audio manager that uses pooling to re-use sounds, so now every actors in the game sends their clip to be played to the audio manager, if it already exists it will just get played again, this way there is no more overlapping.

My issue is that, imagine two doors at both ends or a long room, they close and make a sound when the player enters the room, since both doors closes at the same time only one will have it’s sound played, and sometime it’s the one at the far end with it’s sound inaudible since it’s so far away, this is a problem because the door right behind the player doesn’t make any sound.

Do you guys have any suggestions?

I would fix that part of your code, i.e. you shouldn’t be stuck on only playing 1 of any sound. Each sound should be configurable as to the max number of voices. Maybe defaults to 1 but can be changed.

Either that or you can keep the distance of the audio source (to listener) and play only the closest one.

Let’s say that i shoot projectiles that passes through enemies, and that enemies make a sound when they get shot at, even with only two voices this will cause some nasty phasing and stacking, two of the same sound played at the same time is so much louder, it sounds horrible, phasing is even worse. So i choose to go with 1 voice for all SFX sounds.

I’ve tried the distance check but here’s the problem with 1 voice only, let’s keep the same example as above, enemy 1 gets hit and screams, the bullets keep traveling fast and hits enemy 2 which is further away, enemy 2 tries to scream but the “scream” sound is already being played by an actor that is closer so it just doesn’t play. This doesn’t look good at all.

Thanks for helping.

Sure it could cause phasing. Could minimize that by using different variations of the same clip and adding some code to round robin the variations.

Of course it’s louder. Limiting it to a small number like 2 or 3 would minimize that. Or you could write code to equalize the volume when multiple play.

I don’t see a way for you to solve your problem while only allowing 1 of each voice, except by doing variations.

Thanks for the tips, i’ll give what you suggest a try and see if i can come up with something.

1 Like