PermissionError: [Errno 13] Permission denied: ‘C:\\Users\\langxu\\AppData\\Local\\Temp

Traceback (most recent call last):
  File "D:/桌面备份/脚本/唤醒测试.py", line 15, in <module>
    play(song1)
  File "C:\Users\langxu\AppData\Roaming\Python\Python38\site-packages\pydub\playback.py", line 71, in play
    _play_with_ffplay(audio_segment)
  File "C:\Users\langxu\AppData\Roaming\Python\Python38\site-packages\pydub\playback.py", line 15, in _play_with_ffplay
    seg.export(f.name, "wav")
  File "C:\Users\langxu\AppData\Roaming\Python\Python38\site-packages\pydub\audio_segment.py", line 867, in export
    out_f, _ = _fd_or_path_or_tempfile(out_f, 'wb+')
  File "C:\Users\langxu\AppData\Roaming\Python\Python38\site-packages\pydub\utils.py", line 60, in _fd_or_path_or_tempfile
    fd = open(fd, mode=mode)
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\langxu\\AppData\\Local\\Temp\\tmpjbuaiz4w.wav'

运行时报上方错误,代码中没有显示错误,是由于没有安装pyaudio库,安装相应的库就可以了。

pip install pyaudio

安装成功后,加载环境重新运行就解决问题了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值