gpt4 book ai didi

ios - AVAudioSession 错误 : Deactivating an audio session that has running I/O

转载 作者:可可西里 更新时间:2023-11-01 03:39:37 24 4
gpt4 key购买 nike

2017-02-24 14:56:44.280 PropertyManager[10172:5336578] 14:56:44.280 ERROR:    [0x1a0a24000] AVAudioSession.mm:692: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.

2017-02-24 14:56:44.281 PropertyManager[10172:5336578] error === Error Domain=NSOSStatusErrorDomain Code=560030580 "(null)"
PropertyManager was compiled with optimization - stepping may behave oddly; variables may not be available.

最佳答案

您的错误日志非常简洁地 self 表达:

Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session

它会告诉您问题所在以及解决方案。

现在你正在做这样的事情:

[[AVAudioSession sharedInstance] setActive:NO
withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation
error:nil];

但是,您应该先停止音频播放器实例,然后将激活状态设置为是或否。

[yourAudioPlayer stop];
[[AVAudioSession sharedInstance] setActive:NO
withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation
error:nil];

请参阅 Apple 文档以查看 enum AudioSessionSetActiveOption 的值.

另请参阅:关于 setActive:withOptions 的 Apple 文档方法

关于你的第二个错误

PropertyManager was compiled with optimization - stepping may behave oddly; variables may not be available.

参见 this excellent answer .

关于ios - AVAudioSession 错误 : Deactivating an audio session that has running I/O,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42432997/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com