You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在 2018年3月30日,16:35,Hilen Lai ***@***.***> 写道:
赞,可以提交一个 PR
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
录音时偶现的bug,在stackoverflow找到了原因,应该是录音和播放使用的同一个AVAudioSession,导致崩溃。解决方法是在AudioPlayManager的stopPlayer()方法中加一句代码self.audioPlayer!.prepareToPlay()重置AVAudioSession:
func stopPlayer() {
if self.audioPlayer == nil {
return
}
self.audioPlayer!.delegate = nil
self.audioPlayer!.stop()
self.audioPlayer!.prepareToPlay() //必须加上这一句,否则有可能会出现AVFAudio`-[AVAudioSession setActive:withOptions:error:]:的bug
self.audioPlayer = nil
UIDevice.current.isProximityMonitoringEnabled = false
}
The text was updated successfully, but these errors were encountered: