Update Unity has add Force iOS Speakers in PlayerSetting, you would try this.
This is based on https://github.com/10people/UnitySpeakerFix, I have update code to use on iOS 15.0 with Unity 2021.2.17f1 (Apr, 2022)
When using microphone input, Unity iPhone switches audio output to the earpiece speaker, instead of the usual speakerphone speaker. As a result, all the audio in game suddenly becomes very quiet, even at max volume. In particular, this is problematic for games which include voice-chat.
Simply install the Unity package,
add a call to iPhoneSpeaker.CheckiOSPrepare()
before you call Microphone.Start()
.
add a call to iPhoneSpeaker.ForceToSpeaker()
before you call audio.Play()
.
Base code from these two SO threads: