Initializing microphone on iOS cause any background music stops (ie. from Spotify).
I wrote music visualization app, which listens audio on MIC and is doing some gfx.
On Android works perfect. App can listen external audio and audio from the same phone in the background.
On iOS my app can listen only external audio. It’s impossible to listen internal music through MIC, because my app when initializes MIC force to stop background music.
Player’s option “Mute Other Audio Sources” is un-checked.
From my perspective the only fix is related that launching app kills background music. Now, I can launch an app and background music plays but until MIC initialization will happen.
I’m using Unity 2019.2.9f1 and got the problem also through the previous versions.
Hey guys, we had similar problems with the Unity Engine Microphone class.
We use Unity 2021.1.2f1 version.
We tried different combinations with the Project Settings to let the background audio play on iOS when the User starts to record the audio. Nothing helped.
Yesterday we bought the NatDevice plugin from asset store to solve another problem on iOS. When the recording is started it takes about a second on iOS to actually start. I mean the Microphone.Start() method. On Android it starts instantly.
With the NatDevice plugin both problems are solved. The audio keeps playing in background when you start to record. And there is also no delay when the recording is started. BTW you need to initialize the AudioDevice of the plugin in advance, because on iOS the initialization takes about a second.
If you think the plugin is to expensive, you can try implement it yourself. As I know it uses the AVAudioEngine internally on iOS. You can read through the docs of the plugin, it will give you some useful hits.