我一直在使用Audiokit.stop()
来达到合理的效果,以及我现在要解决的一些小问题。随着最近对Audiokit 4.2的更新,我现在从以下代码中收到(非常有用的)错误消息:
do {
try AudioKit.stop()
} catch {
AKLog("AudioKit did not stop!")
}
我的错误代码是:
2018-04-24 16:14:48.099606+0100 MyProject[517:62626] [avas] AVAudioSession.mm:1142:
-[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.
AudioKit.swift:stop():299:couldn't stop session
Error Domain=NSOSStatusErrorDomain Code=560030580 "(null)"
GameScene.swift:update:755:AudioKit did not stop!
所以我的问题是 - 如何根据错误消息的建议正确停止或暂停所有输入和输出(I / O)?