Stopping and starting looping sound when far away

Hi.
I have a problem that I would like to solve.
If a sound is playing and looping (waterfall), I don’t want to to play when I am over 10 meters away from it, to save CPU resources/voices.
I can set this behaviour from within fmod, by placing the sound on the Distance parameter and set it to not play when distance is above 10 meters.

The problem is that the sound wont start again, when I approach the waterfall again (coming from a distance that is above 10 meters).
I could solve this by making the sound “persistent”, but then it takes up a voice all the time, while I am away from the waterfall.

Is there any fmod solution where the sound turns off when outside X distance and when within X distance, it will turn on again, without having the sound play all the time? (persistent behaviour).
I want to avoid having to set up logic on all my sounds in Unreal that measures distance and turns stuff on/off, but also want to avoid spamming the audio bus in fmod with voices and thereby using up CPU.

Thanks

Hi,

Can I get the version number of the Unreal and FMOD that you are using?

Also, Would it be possible to get a screenshot of how you set the waterfall event in FMOD?

FMOD and Unreal will take care of virtualizing events for you. The Vol 0 virtual setting will automatically virtualize events that are no longer audible to the player. Unreal Integration| 3. Settings | 3.3 Init | 3.3.1 Vol 0 Virtual Level

Please have a look at these docs for connecting your Unreal project to Studio Live Update: FMOD Studio|11. Editing During Live Update. When in PIE collect a profiler capture FMOD Studio|11. Profiling and keep an eye on the overview.

Here you will be able to notice the waterfall event virtualizing itself when it is no longer audible. You can tell the event is virtual as the dot will be hollow and the life span will be dim:

Hope it helps

@Connor_FMOD Is there a bug or something? I keep getting quote replied when I wasn’t the user saying the thing that was quoted

Apologies, that was a mistake on my end. I will fix that now.

Hi. I’m using fmod version 2.2.21

I don’t see the behavior you are seeing.
If I set my Vol0 virtual level to something really high, like 0.1 or so, my sounds are still not being stopped when I am far away (so they go low because of attenuation). They are always playing. Never stopped.

I made a test tone and placed it in the world. It is always playing. Never stopped.
It is simply just starting play on game start, that’s it.

as you can see here, it never stops, even though it is very low:
image

Even though I have this set:
image

The weird thing is, that if I set the value high (0.1 or the like), I can hear that many sounds are not playing. So it’s doing something. But whatever it is doing, is not reflected in the profiler at least.

1 Like

Apologies, I made a mistake.

The Vol 0Virtual Level does not affect the event virtualization, however it controls the voice virtualization. You can watch the voices being virtualized by selecting the Voice view in the profiler:
image

This will still reduce the impact of the event on the CPU. You can view this happening in the CPU view of the profiler:
image
Event audbile:
image
Event inaudible:
image

Apologies for the confusion.

1 Like

Ah!
I thought, since you shared this image:


That the events were supposed to stop/look like that.
But if that’s not the case, then everything is working perfectly. I had a look at the CPU meter and virtualizing does lower CPU.
Thanks a lot :slight_smile:

I Guess it would be even more effecient to build in the logic inside unreal (maybe). But this will def. do for now.
Thanks

1 Like