Force play audio file through iPhone speakers?
Is it possible to force a audio file to play through the iPhone speakers even if headphones are p开发者_如何学Clugged in?
See Audio Session Cookbook: Redirecting Output Audio. Briefly,
- Set the category to kAudioSessionCategory_PlayAndRecord
- Set kAudioSessionProperty_OverrideAudioRoute to kAudioSessionOverrideAudioRoute_Speaker
If that doesn't work, then there probably isn't a way to do it.
Short answer No. Sorry. I tried to find something like this once but no luck. Apple is pretty vaige about this things.
精彩评论