Are there conditions under which FMOD will return an OK result when playing a sound, but the resulting sound does not actually play, or perhaps culls itself somehow (maybe if no listeners are present?)
I’m currently seeing the following scenarios that I think are related.
Issue A: PlayEvent2D doesn’t result in audio
Setup: We have a persistent level with N sublevels. The entire collection of levels are streamed in during the level transition.
What I’m seeing while attached in debug is the following.
1.) A BeginPlay blueprint call that resolves through project code down to a UFMODBlueprintStatics::PlayEvent2D occurs.
2.) The WorldContext, Event, and Autoplay arguments for this are all correct and valid non-null arguments
3.) PlayEventAtLocation fires and successfully creates an Event Instance from the Event Description.
(Note I had to add logging here which I verified with runtime breakpoints to store the FMOD_Result from that in UFMODBlueprintStatics::PlayEventAtLocation. In the current integration, it’s entirely unchecked)
4.) PlayEventAtLocation returns an FFMODEventInstance handle populated with an instance pointer.
5.) In FMOD Studio profiler, this event is not visible/created/existant
6.) A few frames later, a call to set volume on the event instance breaks early because the UFMODBlueprintStatics::EventInstanceIsValid check returns false.
The event is inaudiable. I’ve worked around this by changing the project code to not play the event until PostLoad is complete. When I do this, the sound is played correctly and shows up in FMOD profiler.
Issue B : Audio Components with bAutoActivate return state == Stopped on their first tick after Playing.
1,) We populate an Audio sublevel (similiarly to issue A above) with ambient sounds
2.) During debug, I see their Play calls result in a corresponding Event being created in the project code and the PlayInternal code all firing correctly.
3.) During the very next TickComponent on that object. FMOD returns the state of that studio instance (in StudioInstance->getPlaybackState(&state); on line 385) to be STOPPED, which in turn, halts everything including component tick.
Calling Activate on the component at a later time results in the sound playing correctly as intended.