Hi,
I’ll try describing the issue as short as possible. I have several ambient sounds on map that I want to fire and forget, basic Ambient Sound with Auto Activate enabled (default setting). There may be however many of those on map and I want to do it properly - not spam the audio buffer which causes nasty distortions and other issues. So I set the MaxConcurrentPlayCount to 4.
What I have noticed, is that if there are more AmbientSounds using that specific SoundCue on map than the limit it has, those above the limit will not be fired and will never be fired basically rendering them useless, unless I write my own system that enables sounds as the listener moves around the map, but that’s what the engine should do I believe.
What really happens on the included test map:
- First sounds are set up ok and we’re all happy.
- Limit is reached
- Next sound is not getting activated because of the limit
- Next sounds are also never enabled
- We have several map environment sounds that do not work
Theoretically it’s what should happen, but thing is, that the check for whether to activate given sound does not take into account how close the listener is and whether the sound will actually be heard or is it too far and will not be heard. In the test map there are 6 sounds, all far enough from player to never be heard. Regardless of that fact, 2 sounds are always broken and do not play.
Sounds that have 0 volume and are cut out should not be included in this particular counter. I want to avoid playing 4 simultaneously, not avoid having more than 4 on the map (this I can do easily myself).
What I’ve also noticed, is that when those sounds Auto Play, the listener is not yet initialized, therefore it’s location equals to (0,0,0) which might mess stuff up as well, unless in the next frame the system reacts accordingly (as if the listener was teleported)
For now I’ve increased the limit very high, but problem is I do not know how many sounds will be on the map. We may reach the limit again someday. Also, it is far from ideal, since with this setting I can fill whole audio buffer with just a single ambient Sound Cue, which is what I wanted to use that variable for - to prevent that from happening.
I have looked a bit here and there, unfortunately found no fix for the issue, thus the post. I hope I explained it clear enough for you to follow and that the sample map will show the issue on your side as well. From what I can tell, you’re rewriting Audio system anyway, so this may be worth looking into for the future releases.
Used binary version 4.9.2 to reproduce the problem. Migration to 4.11p8 proved impossible (heavy Sound Cue changes I see), therefore I’ve recreated the project from scratch. Both versions added. Both versions are bugged in the same way. I used stat soundwaves and stat soundcues to determine whether the sound plays or not. Sound I’ve added in the project is under the Creative Commons 0 License, which means - no copyrights whatsoever.