Sound cue with attenuation not working properly

I may be missing something from this or expecting too much from UE4’s audio, bit this feels like a bug.

What I am trying to do is play a ‘splat’ sound when my bullets hit the enemies. I am doing this by playing a sound component attached to the enemy which stops 0.5 seconds after. (The sound cue is looping in an attempt to make this more efficient rather than playing an individual sound for each bullet hit).

In the below video, first you can hear the sounds playing as they should with NO attenuation. But then with any form of attenuation it’s too much for the engine and it just isn’t playing properly :confused:

Hello Lazy Games,

I checked out your video and can hear what you are talking about. Would you mind showing me a screenshot of how you have this sound set up in the Sound Cue Editor?

This will help me visualize the sound you are using. You can try changing the sounds “Distance Algorithm.” For example ‘ATTENUATION Linear’ or ‘ATTENUATION Natural Sound.’

Thanks,

The first screenshot is how I’m getting a looping sound of bullets hitting. Even if I dumb it down like in the second screenshot the problem still persists.

But also note: It seems fine with 1 or 2 enemies but with around 8+ attacking the player it really starts to break up and go crackly.

I tried all the distance algorithms, natural sound does seem to work best but it isn’t perfect. Still missing the cue every now and then when I shoot an enemy.

It just works perfectly with no attenuation, but then with it all being the same volume it just doesnt sound right.

Hey again Lazy Games,

So I have a few suggestions to try in order to assess your situation.

Firstly, are you checking to see if the enemies are hit using an Event Tick in your Blueprints? I ask because the sounds playing could be limited by your frame rate. Meaning, it will only play a certain amount of that sound per frame.

Secondly, try taking out the ‘Looping’ node in your Sound Cue editor, and increase the ‘Max Concurrent Play Count’ to something high like 500. Hopefully one of these suggestions helps resolve your issue, but if not let me know and we can continue to investigate.

Thanks,

I have tried those suggestions but it’s still the same. And I know enemies are getting hit as there are occasions when I kill one but the hit sound wont play and sometimes neither will the death sound.

It does seem that with more enemies (and more sound cues being played) it will skip cues, possible because it can only play a certain amount per tick.

I dont think framerate is affecting it, when I have the level BP or character BP open the framerate takes a dive in PIE so when I play at about 15fps its still the same.

It seems to be mostly down to the enemy attacking cue (which has no attenuation) not allowing anything else to be played at the same time, the audio seems to bog down when the enemy is surrounded but it is still better with ‘natural sound’ rather than ‘linear’ on my cues. I feel like if I could simply unlock the amount of cues we can have playing at any one time my problem will be solved.

Hey Lazy Games,

Ok, glad we were able to rule out those suggestions. I was able to find something that might give you insight on how to resolve your issue along the same lines of what you are describing as your solution.

I found some helpful information that talks about the eventual volume limitations of sound in the engine. It explains that if you exceed this volume than you will hear your sounds, “clip and distort.”

"Regarding loudest potential volume, there is variation in the overall bandwidth to work within. For example, a stereo file at 1.0 volume will be 2x louder than a mono file, likewise (4) mono files would be 4x louder. However, eventually you will hit the overall threshold and the output will begin to clip and distort.

On any given Sound Cue, volume settings up to around 2.0 will increase the perceived loudness of the audio file, and anything above that would not. A single cue will never distort, but you would not want all of your files at maximum volume because it will likely overload when multiple cues play simultaneously in-game."

These are some guidelines and rules for the Audio system of the engine.

Audio Documentation

Hopefully this helps you discover how best to get your sounds to work properly.

Thanks,