- Home /
How to force audio through iPhone loudspeaker when microphone is being used?
I have come across the same question on various sites, such as here: http://answers.unity3d.com/questions/257240/microphonestart-stops-audio-from-playing-on-ios.html
But I have been unable to find a solution that works for me. My game uses the iPhone's microphone for most of it and the problem I have is that when the mic kicks in, the game's output audio switches from the loudspeaker to the ear-piece speaker, dramatically dropping in volume.
This is the only solution I have found: https://github.com/cbaltzer/UnitySpeakerFix but it seems to involve downloading a plugin. I have read that plugins are only usable in Unity Pro and I am using the free version, so I don't think I can use that fix.
I was thinking this would be an easy problem to fix but I'm not so sure now!
Does anyone have any ideas? And if the above fix can be used in Unity free, how would I go about getting it into my project?
Thanks in advance for any help! :-)
Thanks for your reply! I did see that link but don't understand the code. I'm fairly new to coding and am only familiar with C# & a bit of JavaScript as used in Unity. Do you know how I'd go about converting that code into something I could use in Unity?
@philsko, you could download the package at the release tab
There's no restrictions on using plugins with Unity free, unless (very unlikely, by the way) the plugin includes calls to something that's not in Unity Free, like the profiler.
Just throw the scripts from the github page in your project, in the same folders as they're in the download, and follow the instructions.
Wow. I did actually try that yesterday, but it wouldn't build properly through Xcode. I'd assumed it was to do with not being allowed to use plugins on Unity free as in the docs it says: "Note: On the desktop platforms, plugins are a pro-only feature." That must be referring to a different type of plugin though as I gave it another go after your suggestion and it's worked! I only imported the Assets folder in this time, have just realised where I went wrong initially, by importing the Project Settings folder in as well. Cheers Baste!
I got the same Need. I use android develop tools eclipse and android studio, write a little activity, but it is hard to co-work with unit. I think maybe Unity $$anonymous$$m should solve this problem.
Answer by daveHG · Jan 26, 2019 at 06:14 PM
Unity now has a "Player Setting" for iOS called "Force iOS Speakers when Recording" turn this on. Much easier than a plugin.