You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

驾驶员疲劳检测系统线程异常及PermissionError问题求助

问题:驾驶员疲劳检测系统线程触发语音警报权限错误

我正在做名为Driver Drowsiness System的毕业设计,使用haar-cascade与OpenCV实现核心功能。当检测到驾驶员疲劳或打哈欠时,通过Python Threading模块触发两种不同的语音警报,但第二次检测到打哈欠时,第二个线程抛出ThreadException,具体报错为PermissionError: [Errno 13] Permission denied: 'welcome2.mp3'。

控制台完整报错信息如下:

python .\drowsiness_yawn.py
-> Loading the predictor and detector...
-> Starting Video Stream call2 call2 Exception in thread Thread-2 (alarm): Traceback (most recent call last): File "C:\Users\avdhu\anaconda3\envs\project\Lib\threading.py", line 1038, in _bootstrap_inner
self.run() File "C:\Users\avdhu\anaconda3\envs\project\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs) File "C:\Users\avdhu\OneDrive\Documents\Python Scripts\Drowsiness-and-Yawn-Detection-with-voice-alert-using-Dlib\drowsiness_yawn.py", line 39, in alarm
myobj.save("welcome2.mp3") File "C:\Users\avdhu\anaconda3\envs\project\Lib\site-packages\gtts\tts.py", line 324, in save
with open(str(savefile), "wb") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: 'welcome2.mp3'

已提供相关代码,请求技术帮助。

内容的提问来源于stack exchange,提问作者Avdhut Joshi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 22:52:37