Audio Session Services: kAudioSessionProperty_OverrideAudioRoute with different routes for input & output

﹥>﹥吖頭↗ 提交于 2019-12-04 04:06:38

You can do this in iOS 5 with the properties:

kAudioSessionProperty_InputSource 
kAudioSessionProperty_OutputDestination 

For the possible values (what sources \ destinations are available on the device) use AudioSessionGetProperty with the properties:

kAudioSessionProperty_InputSources
kAudioSessionProperty_OutputDestinations

For iOS 3.1+, I assume you're using the PlayAndRecord audio session category - you might want to try setting kAudioSessionProperty_OverrideCategoryDefaultToSpeaker to true. For instance,

UInt32 defaultToSpeaker = 1;
status = AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryDefaultToSpeaker,                        
                                sizeof (defaultToSpeaker),                                   
                                &defaultToSpeaker                               
                                );

Might not be exactly what you're looking for, but I don't think you can come closer in < iOS 5.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!