- Home /
iOS "Mute other audio sources" disabled but not working
On iOS the "Mute other audio sources" button doesn't seem to be working in the player settings. It's disabled but opening my Unity app still pauses Spotify and other background music, despite having 0 audio in my app. Testing on iPhone XS.
Answer by timwzw · Feb 23, 2019 at 08:45 AM
By manually write code PlayerSettings.muteOtherAudioSources = false;
before BuildPipeline.BuildPlayer()
, you can fix this bug.
Answer by Annopolus · May 28, 2019 at 09:51 PM
HI @timwzw & @jeremydulong , thank you for your suggestions. I noticed little improvement.
Before your workaround, starting UnityApp immediately killed background music. After it, starting UnityApp let the music continue play (not always) till I'm initializing MIC. It kills background music.
This issue was reported: https://issuetracker.unity3d.com/issues/ios-unity-player-does-not-respect-the-mute-other-audio-sources-toggle-in-player-settings
however I dont understand what is there: 2018.3.8 has in the relase notes confirmation that bug was fixed and in the issue tracker is stated that only 2019.2 will be fixed. Whatever, I'm using 2019.1.4 and problem still exists :-(
Any advices? Case is simple: music visualization where the music could come from internal and external (MIC).
Hello @Annopolus. I don't have an actual solution to your problem, but I do have a word of warning.
If you are to achieve what you are trying to do (play music from the iOS device and use the microphone to record what has been played) you will also have to take into consideration that under no circumstances can you allow the microphone input to be heard and mixed in with the actual playback sound as well, as this would result in a matter of seconds in a completely uncontrollable feedback loop that can easily damage the device's speakers and users ears (high pitched sound you sometimes hear on concerts). These feedback loops spiral out of control incredibly quickly and you as a developer have to keep that in $$anonymous$$d and tight control over it.
The reason behind a feedback loop, in your case, would be that the microphone would "hear" and playback what the device has already played and will superimpose that same signal on top of the original, offset by a few milliseconds. That tiny offset and doubling of the signal lead to an exponential buildup because once the feedback starts, the original sound is louder, the mic picks it up, even more, superimposes doubled signal on top of a doubled signal, and before you know it, all you hear is a high pitched screa$$anonymous$$g sound that keeps growing louder and louder. When used intentionally, a very powerful effect, but when not used intentionally, that means that feedback protection tools (like a master limiter) are most likely not in place, and that opens the door to the device and user hearing damage.