Sound mixes cannot be applied in GameInstance Init event

Repro steps in blank project:

  1. Import some music to test with and create a sound cue with it
  2. Create a new SoundMix asset
  3. In level blueprint, play the sound cue, then push the mix and use the mix to override the volume of the Master sound class to 0.

  1. Play and make sure the audio fades out as expected.
  2. Create a new GameInstance blueprint and set it in project settings.
  3. Override the Init event and move the sound mix nodes from the level blueprint

139272-2017-05-26+23_20_35-newgameinstance.png

  1. Play and observe that the sound doesn’t fade out like it did previously

I took a quick peek at the code and it looks like this happens because the audio device is created after the GameInstance is initialized, so attempting to use audio functions at that point actually seems to be running them on the editor’s audio device.

If you try to play a sound in GameInstance Init, it seems to not be audible until the game is actually stopped, then runs in the editor with no way to stop it.

I assume this can be solved by initializing the audio device before the GameInstance.

A 0 second delay before using audio functions is also a quick workaround.

1 Like

Hello Acren,

I was unable to reproduce your issue on our end using the repro steps you have provided. I have a couple of questions to help narrow down the issue you are experiencing.

  1. Do you have a project you could provide where this issue occurs?
  2. Does this issue occur in just 4.16 for you, or does it occur in other engine versions?
  3. does this issue occur if you do not use the Master sound class?

Thanks!

  1. Sure, I’ve attached a project for you to look at. Expected behavior is that the GameInstance fades out the volume, but it doesn’t happen unless it is after a delay node.
  2. Issue is not isolated to 4.16, have noticed in 4.15 too.
  3. Yes, it doesn’t matter which sound class is used.

Hello again Acren,

I was able to reproduce the issue you are experiencing. I have reported this issue, which you can view here:

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

On another note, I did not have this issue occur for me in the standalone game and packaged build. Depending on the mode used, the order in which things are called can change. So on my end, it appears this issue is happening in the editor only.

Cheers!