使用iOS10,管理AUdioSession的可能性更大,但是当音频通过
iphone扬声器输出时,我无法将耳机麦克风作为输入.
下面的’overrideOutputAudioPort’方法也会将输入音频端口覆盖为iphone麦克风
let session = AVAudioSession.sharedInstance() do { try session.setCategory(AVAudioSessionCategoryPlayAndRecord) try! session.overrideOutputAudioPort(.speaker) } catch { }
是否有任何解决方案可以保持耳机输入?
解决方法
我如何解析
this Apple documentation,使用AVAudioSession是不可能的:
If a headset is plugged in at the time you set this property’s value to kAudioSessionOverrideAudioRoute_Speaker,the system changes the audio routing for input as well as for output: input comes from the built-in microphone; output goes to the built-in speaker.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。