Hi there!
I just pretty much finished migrating all the audio of my Unity game to FMOD, and now I’m running into an issue with iOS that I don’t know how to solve.
Some context: the game makes heavy use of voice input. By default it should use the speakers of the device for its audio output, the internal mic for input; and when a headphone is connected, it should switch output to that headphone and use its mic if there is one.
To make this work on iOS, I already before needed to set AVAudioSession to AVAudioSessionCategoryPlayAndRecord; i am using AVAudioSessionModeDefault and for options: AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetooth. This worked alright before FMOD.
Now with FMOD, and the same settings, the audio and mic still works with speakers, but as soon as I connect a headphone, I don’t get any audio output anymore. Not in my headphones, and not on the speakers. Only when i disconnect the headphones does the sound resume.
I tried different AVAudioSession configurations, but without success. If I only set AVAudioSessionCategoryPlayAndRecord and no options, the sound only comes out of the receiver (the small speakers used for phonecalls) and it does not switch to bluetooth headphones when connected. Same if I add the option AVAudioSessionCategoryOptionAllowBluetooth.
I found this post which sounded like a similar issue; it didn’t seem to come to any conclusion though. I spent so so much time integrating FMOD, I really hope there is a solution for this; using voice input in games is probably only becoming more commonplace in the future. Please, point me in the right direction!
Thank you! –Simon