Ambient Sounds delay playing between spawn points - Need Help

Hi Guys,

This is driving me mad and I did search and search but no luck - UE4.23 - I have ambient sounds scattered around the map with Attenuation that work nicely (water falls etc) , When my player spawns between multiple points there is a 1-2 second delay before the sounds is heard…Fired sounds work immediately… Please help

This is most likely due to the having a number of looping sounds attempting to play after loading in at once (even beyond audible range. In fact, this can exacerbate if they attempt to play immediately prior to closer ones playing) and/or how it reacts to the new Virtual Loop feature.

The following commands are available for tweaking whether the feature is enabled or disabled (recommended to leave on as its a big performance win when your level has lots of ambient looping actors), the distance between listener and source used to scale how often virtualization/realization swapping is checked, and the respective minimum and maximum update rates (which default to 0.1s and 3.0s).

au.VirtualLoops.Enabled
au.VirtualLoops.PerfDistance
au.VirtualLoops.UpdateRate.Min
au.VirtualLoops.UpdateRate.Max

Once you have tweaked these to your liking, you can either set them directly in code/script or set them and leave them from an .ini file.

Alternatively, once your player has spawned in and is ready, you can call something like the following to force the virtual loops to all update state immediately:
FAudioThread::RunCommandOnAudioThread(]()
{
if (GEngine)
{
if (FAudioDevice* AudioDevice = GEngine->GetActiveAudioDevice())
{
AudioDevice->UpdateVirtualLoops(true);
}
}
});

1 Like

Hi, how do I set the variables in the .ini files? Thanks.