Unity Microphone Class gives issues with earphones plugging/un-plugging in

We are using the Unity Microphone class to record , play and stop audios in our game .

In iOS we use the settings : Prepare iOS for Recording is enabled as we need to reduce latency for when recording starts
Force iOS Speakers When Recording : This setting is causing issues for us when the user wants to use headphones , because it routes audio to the speakers even if the user is on headphones.If we disable the above setting , the functionality works fine for headphones but on plugging/un-plugging earphones the volume of the speakers drops drastically and is hardly audible

We have used the speaker fix solution GitHub - 10people/UnitySpeakerFix: Forces audio to speaker while using the mic, on iPhone , but its working for OS version less than 12 only, what about iOS versions greater than 12 ?

We have followed steps mentioned in the thread : Audio coming out of small phone call speaker instead of speakers on bottom. as well , but the solution was to use the UnitySpeakerFix script which isn’t working for us.

1 Like

Hey just struggled with this myself

try GitHub - reivendark/UnitySpeakerFix_iOS7plus: Fix for switching active iOS speaker to speakerphone speaker instead of earpiece speaker in Unity applications

fixed it for me.

1 Like

Hey anyone found the solution for this problem, How to output audio through speakers instead of from an earpiece in IOS, Is there any method, or process for it. and when connecting to a Bluetooth it should switch to it.