播放音频结束后,通知中断程序中断已经结束,可以恢复播放
在音频播放完毕,加上以下代码
do {
try AVAudioSession.sharedInstance().setActive(false, with: AVAudioSessionSetActiveOptions.notifyOthersOnDeactivation)
} catch let error as NSError {
print(error.localizedDescription)
}
播放音频结束后,通知中断程序中断已经结束,可以恢复播放
在音频播放完毕,加上以下代码
do {
try AVAudioSession.sharedInstance().setActive(false, with: AVAudioSessionSetActiveOptions.notifyOthersOnDeactivation)
} catch let error as NSError {
print(error.localizedDescription)
}