Audio Source can still be heard at long distance (Audio Glitch)

Hello. A long term issue I have had with Unity is that the Audio Sources, once activated, can be heard all over the map. I thought I had fixed this a while ago using this, but it recently came back with a vengeance. Now the issue is that the audio source drops off far too slowly, meaning that while it should really mute at a distance of 3, it instead can be heard across the map.

I have also encountered a second issue where even manually deleting the audio source from the object in Inspector won’t shut off the noise. Instead, it keeps playing on the object, and only disabling the object itself will stop it. This seems to be a bug, honestly.

I added a Sound_Emitter to try to make it respect walls, but that didn’t work either.

How are you moving around the map? If you’re switching back to the scene view after hitting ā€˜play’ and moving around then the sound’s volume won’t diminish because the scene view’s camera doesn’t have an audio listener. I suspect that for whatever reason your audio source always has an audio listener nearby.

Building on what Zulo says above… you should SEE on the AudioSource itself the distance to the listener as a vertical line labeled ā€œLISTENER,ā€ something like this:

It is live-updated as you move either the AudioSource or the AudioListener around. You can open a dupe Inspector window on the source and lock it to watch as you move your listener.

1 Like

I’m moving the player around the map the way you would in the game, and listening with them. I don’t think scene view has audio?

I can, and it seems to work there. Thing I’ve just noticed is that there are actually TWO sounds. There’s the sound of the thing itself, which actually does drop off properly. That’s the one coming from the Audioo source. But then, there’s this ā€˜other’ sound that plays even if you delete everything on the gameObject, but stops when the gameObject is disabled or deleted.

I have no idea what to even debug with this. There’s no code.

Oh, and I don’t know if it matters, but these are VFX objects. Which I am also suddenly having issues with. Seems the particle system is adding a blank particle emitter to all my VFX that spews magenta cubes at me. Dunno why. Only shows up in the play window.

If you’re new to VFX graph and you’re fumbling around with a prefab that uses it then it’s possible that the particle system is set to trigger a script on a specific event. And the script may in turn be playing a sound. With as many particles as shown in your screenshot I’d get rid of the script and have it play a looping sound (rainfall?) while the particles are active. Because triggering/playing 100s of sound per second can’t be good for performance.

If there’s a script, it’s not one I know about. Sorry. It’s actually playing some kind of ominous background ambiance thing. Doesn’t seem to be multiplying copies.

Honestly, I am new to VFX, though. I can’t find any working tutorials for HDRP.

My listener is attached to the player, which is all the way across the map.

I’m still not sure why deleting the audio source doesn’t stop the sounds, but disabling the now-blank gameObject does.

If your particle system is triggering a script that’s playing a sound then it may be playing the sound through PlayClipAtPoint which temporarily instantiates a gameObject with its own audio source. You may be able to see it in the hierarchy.

1 Like