FMOD_STUDIO_EVENT_CALLBACK_DESTROYED is only called when the actual Event Instance is destroyed, otherwise FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED will tell you when the programmer sound stops.
I’m not able to reproduce this myself, it appears to be behaving as expected.
What versions of FMOD and Unreal are you using?
Hi cameron,
I am encountering no single callback being called. I assume that using the flag
FMOD_STUDIO_EVENT_CALLBACK_ALL
to register to callbacks allows me to listen to all of them. But none of them is called for me.
I am using UE 5.5 and FMOD 2.03.05 EA
Also, when the callback should fire, I am tabbed out of the game to see wether the whole “muting while the game is not in focus” works (which it does).
If it helps I can give access to the Unreal Engine project on github so you can view the source code.
@Connor_FMOD Hi no problem, had family at my house over christmas so had no time anyways.
I invited you to my repo “Tufu”. You just have to put the latest FMOD plugin into the “Plugins” folder and it should work.
When you are in editor simply start the game. When the game is focused and a song is finished playing you will see inside the log that the music stopped. If the game is not in focus you will see no callback is happening
You will find everything inside the class Sound/TUFUSound.
MuteOnWindowFocusLost() is called when unreal engine gains/looses focus. I currently have a workaround which somehow doesn’t work correctly yet, where i track start time of a song and check after the game gains focus wether the length of the song has passed already.
PlayTUFUTraxSong() starts a song and binds the callback to the EventInstance
It seems that I am still getting the create sound callback. This is making me think that it may not be related to the volume rather how UE is handling putting the project in the background.
Is the desired behavior for music to continue playing silently in the background or to pause?
Would it be possible to run a profiler session when back grounding the project and upload the session to your profile with the following settings
No worries! I hope you are feeling better. Thank you for the information. I will have another look at the behavior. The profiler session would be great!
Inside the Update() function is a state machine, per state the phone calls you can hear in the video are played back. For a state to progress I track that 8 seconds have passed and the audio is finished playing (CareerSpeech->Stage0IsSpeechDone()).
In this function I simply check wether the UFModAudioComponent for the phone calls exists and if its playing. But after tabbing out the FMOD Audio components is still in the playing state, thus the game logic hangs infinitely.
I am currently uploading the profiler session (its a whopping 800mb in size). Sorry for the massive delay, the profiler didn’t connect to Unreal until i noticed that I have to enable “Live Update” in the Unreal Engine project settings.
Yeah the same problem is with any Event when tabbed out.