3D sounds disappear with no reason in rare cases

Hello,

I have a issue that I don’t understand. Sometimes in rare case, the 3D events disappear at the launch of a level, and we ear only 2D events, as if my Listener gone off (but no reason for that).

I don’t success to reproduce this bug, it seems to be random, but significant amount of people have this bug playing my game.

For information :

  • the bug seems to stay even if the player load another level.
  • in my scenes, there is only one Studio Listener (which is always on my character controller), and three Camera (but no enable at the same time).
  • i also use Resonance Audio plugin

Have you tried using the Studio Profiler? It may help to understand what is going on in the scene as it can show Event positions relative to the listener, as well as a number of other useful tools.

I didn’t succeed to reproduce this bug.

But I know new things about this :

  • The 3D events disappear completely, even if there is no distance attenuation on it (which I really don’t understand, so it’s not the listener which gone far away).

Extra info that I can give :

  • I have not disable unity audio, which I use for certains purposes (like pause or loading sounds).
  • I use the FMODUnity.RuntimeManager.GetBus(“bus:/”) to pause and stop all events when I change scene.

I hope those informations can help you to understand the origin of this bug.

Are the 3D Events attached to gameobjects in the previous scene?

Most of 3D events are placed with set3DAttributes (with transform, gameObject or Vector3 in parameter).
I create the instances (with “CreateInstance”) at Awake, at the launch of the scene.

And the others 3D events are Event Emitter, that I don’t touch with script.

When I go to a next scene, I go firstly through a loading scene (where I stop all the sounds of the previous scene with “GetBus(“bus:/”).stopAllEvents”) and I load the next scene.

Do you get any errors or warnings in the console log?

Three warnings on the console at the start of scene :

[FMOD] SystemI::init : Output requires a sample rate of 48000Hz, resampling will occur.

13 of this :
[FMOD] Instance of Event event:/xxx/xxx has not had EventInstance.set3DAttributes() called on it yet!
(But these are sounds that I don’t have played yet, so this is normal)

And 10 of this :
[FMOD] EventInstance::update : Event {xxxxxx-xxx-xxxx-xxx} waited 190 milliseconds for sample data to load. Preload sample data to avoid this delay.

I would add some logging to print things like Event position and playback state.