RemoteIO 的 AudioSession 设置可与 iPod 完美配合
正如我之前在此处找到的那样。
如果您在使用远程 I/O 回调播放音频时开始运行 AVAssetReader,则启动 AVAssetReader 将阻止远程 I/O 回调,除非您允许 iPod 与...
UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,sizeof(audioCategory),&audioCategory);
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof (UInt32), &(UInt32) {1});
但是我发现这会阻止使用音频远程按照设置控制呼叫 此处。
所以...
- 我需要“MixWithOthers”打开才能使用 AVAssetReader
- 我需要“MixWithOthers”关闭才能使用音频远程控制
有谁知道如何设置我的 AudioSession 以便我可以同时使用两者?
As I previously found here.
If you start running an AVAssetReader while using a Remote I/O callback to play audio, starting the AVAssetReader will block the Remote I/O callback unless you allow iPod mixing with...
UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,sizeof(audioCategory),&audioCategory);
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof (UInt32), &(UInt32) {1});
However I am finding that this prevents the use of Audio Remote Control calls as setup here.
So...
- I need "MixWithOthers" ON to use an AVAssetReader
- I need "MixWithOthers" OFF to use Audio Remote Controls
Does anyone know of how I can setup my AudioSession so I can use both?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在,这在 iOS 5 中有效。正确的处理是将 MixWithOthers 关闭。 AVAssetReader 将不再停止音频播放的回调。
This works now in iOS 5. The correct handling is to leave MixWithOthers OFF. The AVAssetReader will no longer stop the callbacks of your audio playback.