[英]how to give the two categories in AVAudioSession set category
I am using the "AVAudioSessionCategoryPlayAndRecord" category for the audio session. 我在音频会话中使用“ AVAudioSessionCategoryPlayAndRecord”类别。 But it didn't plays in silent mode. 但是它没有在静音模式下播放。 I need to give "AVAudioSessionCategoryPlayback" also. 我还需要提供“ AVAudioSessionCategoryPlayback”。 But only one can be given. 但是只能给出一个。 I need both categories. 我需要两个类别。 If any one knows the answer please help me. 如果有人知道答案,请帮助我。
From Apple doc - the mode "AVAudioSessionCategoryPlayAndRecord", should play in silent mode. 从Apple Doc-模式“ AVAudioSessionCategoryPlayAndRecord”应在静默模式下播放。 It sounds like this is the only one you need. 听起来这是您唯一需要的一个。 Maybe you missed this note: 也许你错过了这个笔记:
Note: For your app to continue playing audio when the Ring/Silent switch is set to silent and the screen is locked, make sure the UIBackgroundModes audio key has been added to your app's Info.plist file. 注意:为使您的应用程序在“铃声/静音”开关设置为“无声”且屏幕锁定时继续播放音频,请确保已将UIBackgroundModes音频键添加到应用程序的Info.plist文件中。 This requirement is in addition to your using the correct category. 此要求是您使用正确类别的补充。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.