Skip to content

Forces audio to speaker while using the mic, on iPhone

Notifications You must be signed in to change notification settings

kkkkoyo/UnitySpeakerFix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Update Unity has add Force iOS Speakers in PlayerSetting, you would try this.

WARNING

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)


Unity iPhone Speaker Fix

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.

How-To

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().

Credit

Base code from these two SO threads:

About

Forces audio to speaker while using the mic, on iPhone

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 53.7%
  • C# 46.3%