New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AVFAudio`-[AVAudioSession setActive:withOptions:error:]: #40
Comments
赞,可以提交一个 PR |
Ok,最近比较忙,我的项目里集成了你的项目,做二次开发,所以发现了不少bug😂,到时候我整理一下,然后再PR。
发自我的 iPhone
… 在 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.
|
感谢感谢~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
录音时偶现的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: