Audio coming out of small phone call speaker instead of speakers on bottom

This is a weird one. I did a release recently using XCode 5 to support iOS7.

Now, I’m getting several reports that game-audio is coming out of the tiny ear speaker on the top front of the phone (The speaker used when on a phone call) instead of the larger speakers on the bottom of the phone.

I think most the reports are from people with iPhone5s but can’t confirm.

Anyone else see this and/or know how to fix it.

-Jeff

Are you using the microphone?

Either way, try this: GitHub - cbaltzer/UnitySpeakerFix: Forces audio to speaker while using the mic, on iPhone

It’ll force the audio output back to the bottom speaker.

1 Like

I’m not purposefully using the microphone, but possible I enabled it by accident during deploy. I’ll did around XCode and see if I accidently enabled it.

Thanks for the fix… will give that a shot if I can’t fix it in XCode.

Did you solve the problem, I have exactly same problem ?

@jeffweber @cbaltzer

We have the same problem, but where wondering if this fix forces audio to the speaker EVEN when a headphone is plugged in?
Our app is allready on the appstore and need to fix this ASAP.

Thanks in advance.

I also have same problem. I have Unity 4.5.2 installed and Xcode 5.1.1. What is weird is that this worked fine a couple a days ago. So is it unity or xcode or ios that is the problem ??.

It seems to work fine when applying the fix from GitHub - cbaltzer/UnitySpeakerFix: Forces audio to speaker while using the mic, on iPhone thank you for that cbaltzer. But the issue still exist on the iPhone 5s

I have tested on these with the fix applied.
iPhone 5c(worked)
ipad 1(ios 5 worked)
ipad mini(worked)
iphone 5s(no sound from speakers)

Does anyone know if downgrading xcode or Unity would solve this ?

Hi all. I also had the problem and I was able to resolve it by unchecking “Prepare iOS for recording” in the Player Settings. I am using Unity 4.6.0p1
Please verify if it works for you as well.

1 Like

Finally! thanks!

Thank’s very much. I solved my problem :smile:

is not working any idea? :frowning: seems was not working in xcode 7

got this error from cloud build
[xcode] /BUILD_PATH/samwit.watson-space-01.default-ios-5-3-1f1/temp.C5fLMz/Libraries/Plugins/iOS/iPhoneSpeaker.m:34:11: error: cast of C pointer type ‘CFStringRef’ (aka ‘const struct __CFString *’) to Objective-C pointer type ‘NSString *’ requires a bridged cast

http://answers.unity3d.com/comments/1111125/view.html

That’s an easy fix, just make it a bridged cast in xcode.
The problem I’m having is that if you do this while there are headphones plugged in, and then unplug the headphones, the sound still comes through the ear speaker. Any clues?

I’m having the same issue, any ideas? Its driving me crazy thanks

Yeah… just hit this iPhone earpiece instead of speaker problem using Photon Voice. Has anyone found the culprit yet?

Tap tap tap … Testing … Is this thing on ? testing…

It appears to be a unity <?> bug - not sure if anyone has reported as such.
The way around it is at the start of a scene (or when you implement audio) to put into the code:

using UnityEngine.iOS;

if((Device.generation.ToString()).IndexOf("iPhone") > -1){  //for iphones only
       iPhoneSpeaker.ForceToSpeaker ();
}

Hello, I have update this fix to new version( above iOS 7.0, at Nov, 2018), and it’s ready to use
https://github.com/10people/UnitySpeakerFix

information devices : iphone 6s ios 12 , Samsung "android 7 ".
unity version : 2018.2.12f1.

i tried speaker script is work fine with my iphone , but still there is problem
the problem is : microphone not work i don’t hear anything in anther device !

 iPhoneSpeaker.CheckiOSPrepare();
        AudioClip_m = Microphone.Start(null, false, 100, 44100);
        Microphone.End(null);
        iPhoneSpeaker.ForceToSpeaker();

i think iphone mic not sent to anther device after apply script .

i am work from 4 days ago still i have some problem.

anyone !!

UP