是否可以将音频放入“电话”中?模式?
我的意思是,使用扬声器和手机麦克风,但不要以免提方式使用扬声器。
所以用例是: 1. 用户正在通过手机扬声器收听应用程序 2. 他们希望将电话放在耳边,因此他们选择一个选项,将音频更改为好像他们正在打电话一样(即非免提模式),
这有意义吗?或者这应该自动发生?
By this I mean, use the speaker and phone microphone but don't use the speaker in the handsfree style.
So the use case is:
1. User is listening to the app via the phones speaker
2. They wish to put the phone to their ear so they choose an option which changes the audio to be as if they were talking on the phone (i.e. non-hands free mode)
Does this make sense? Or should this happen automatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将音频会话类别设置为 AVAudioSessionCategoryPlayAndRecord:
这会将所有音频输出路由到接收器 - “打电话时放在耳边的小扬声器”。请参阅 音频会话编程指南:配置音频会话了解更多详细信息。
You'll want to set the audio session category to AVAudioSessionCategoryPlayAndRecord:
This will route all audio output to the receiver--"the small speaker you hold to your ear when on a phone call". See Audio Session Programming Guide: Configuring the Audio Session for more details.