In my iOS game I notice the speaker volume automatically decreases while I’m recording with the mic. I’m using the following C# code in Unity to record a short piece of input from the mic and then analyze audioSrc to see if there was any blowing. I repeat this for a short while.
audioSrc.clip = Microphone.Start (null, false, 5, FREQUENCY);
The whole time I’m also playing some background music, and it is during the execution of the above command that the music volume drops for a bit and then comes back right after recording stops.
I’m not sure if this is specific to Unity 3D on iOS only, or whether this is behaviour common to iOS applications. I haven’t noticed the same behaviour on Android. Does anybody know of a way I can prevent this on iOS? If necessary I can execute Objective-C code from Unity to call the iOS APIs.