I’ve just hit a weird behavior with a dynamically created/played FMOD::Sound (I need to use Core API because I need to get/setTimelinePosition often and it does not work well with Programmer Sounds)
What I do:
- on initialization, retrieve and keep a reference to the Track bus that I setup in FMOD Studio to control the volume of the music track and calling MyTrackBus->lockChannelGroup() to ensure it’s always available
- when selecting a music, create the FMOD::Sound with createSound()
- when hitting play, first get the ChannelGroup associated with my bus with MyTrackBus->getChannelGroup(&MyTrackChannelGroup)
- then playing the sound on that channel group using playSound(MySound, MyTrackChannelGroup, false, &MyPlayChannel)
What happens next:
- the sound is downmixed to mono, by using Live Preview in FMOD studio I specifically see the In view of my Track Bus shows only one side moving
- weird thing : when moving the Track Bus during Live Preview, the sound gets back to being stereo
- I tried playing the sound directly on the Master bus (passing nullptr to playSound), the issue does not happen and the sound is properly played as stereo
What do I do wrong and where does it happen? Opening the sound? With the ChannelGroup?
Edit: the issue also happens with a FMOD Event containing a Programmer Instrument. I see that if I leave the Event input format to Automatic, and it contains only a Programmer Instrument, the format is set to mono. And it stays this way after calling SetProgrammerSoundName (from UE4) using a stereo audio file.
If I force the Event format to Stereo (by right-clicking on the input meter), it’s still downmixed to mono and panned to stereo (I see the meter being perfectly in sync on both sides). However, if I add a stereo file as placeholder in the Programmer Instrument, the Event format automatically switches to Stereo, and the playback seems correct (now I see the meters being slightly different on each side).
So what happens when I set a stereo preview that makes the Programmer Sound properly play stereo, and how can I do the same with API calls, given that for this sound I can simply leave the placeholder to have the Programmer Instrument play properly, but I do have another Programmer Sound that I need to play using FMOD system API only.
Edit2 : I fixed my problem by setting up a programmer sound with a stereo preview to be routed to my Track Bus, forcing it to stereo format. Now if I create and play a Sound on that Bus as described in my first post, there is no downmixing.
So no urge here, my problem is fixed, but I would be curious to get some insight on what happened here and some best practices using Programmer Sounds.
Thank you for sharing the solution to your problem, apologies I didn’t get back to you. I will continue to investigate this and if I find anything I will let you know.
Again, thank you!