Ynau Ynau - 1 year ago 94
Objective-C Question

App's audio not working through speakers

There's a weird bug in my app. I'm using AVAudioPlayer to play sounds (multiple instances of it), the sound works perfectly through headphones, but using the app without headphones produces no sound from the speaker. All of the audio clips are AAC encoded.

I have tried setting the AVAudioSession properties both through the Objective-C API ([AVAudioSession sharedInstance]) and the C API, but none of the the options seem to work.

Answer Source

ISSUE on iPhone - when sound was very low - seemed it was coming out the phone ear piece (not headphone jack) instead of bottom speaker - change to DEFAULT TO SPEAKER


    UInt32 doChangeDefaultRoute = 1;

    AudioSessionSetProperty (
                         sizeof (doChangeDefaultRoute),
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download