Python弹奏模块“驱动程序无法识别指定的命令参数。”
这是我正在运行的代码:
from playsound import playsound
import threading
threading.Thread(target=playsound, args=('Assets\Loss.mp3',)).start()
当我运行此问题时,会给我这个错误,
Error 259 for command:
play "Assets\Loss.mp3" wait
The driver cannot recognize the specified command parameter.
Error 305 for command:
close "Assets\Loss.mp3"
Cannot specify extra characters after a string enclosed in quotation marks.
Failed to close the file: "Assets\Loss.mp3"
Traceback (most recent call last):
File "C:\Users\ekila\Downloads\Smart Auto Bet\Test.py", line 10, in <module>
playsound('Assets\Loss.mp3')
File "C:\Python310\lib\site-packages\playsound.py", line 73, in _playsoundWin
winCommand(u'play {}{}'.format(sound, ' wait' if block else ''))
File "C:\Python310\lib\site-packages\playsound.py", line 64, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 259 for command:
play "Assets\Loss.mp3" wait
The driver cannot recognize the specified command parameter.
这更感兴趣的是,当我将mp3移至同一文件夹并运行时,
from playsound import playsound
import threading
threading.Thread(target=playsound, args=('Loss.mp3',)).start()
它的效果很好,没有错误,但我想拥有mp3存储在子目录中,
- 我已经安装了1.2.2版。
- 我尝试过不穿线运行它
Heres the code I'm running:
from playsound import playsound
import threading
threading.Thread(target=playsound, args=('Assets\Loss.mp3',)).start()
When I run this it gives me this error
Error 259 for command:
play "Assets\Loss.mp3" wait
The driver cannot recognize the specified command parameter.
Error 305 for command:
close "Assets\Loss.mp3"
Cannot specify extra characters after a string enclosed in quotation marks.
Failed to close the file: "Assets\Loss.mp3"
Traceback (most recent call last):
File "C:\Users\ekila\Downloads\Smart Auto Bet\Test.py", line 10, in <module>
playsound('Assets\Loss.mp3')
File "C:\Python310\lib\site-packages\playsound.py", line 73, in _playsoundWin
winCommand(u'play {}{}'.format(sound, ' wait' if block else ''))
File "C:\Python310\lib\site-packages\playsound.py", line 64, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 259 for command:
play "Assets\Loss.mp3" wait
The driver cannot recognize the specified command parameter.
What's a little bit more interested is that when I move the mp3 to the same folder and run
from playsound import playsound
import threading
threading.Thread(target=playsound, args=('Loss.mp3',)).start()
It plays perfectly fine with no errors but I want to have the mp3 stored in the subdirectory
- I have playsound version 1.2.2 installed.
- I've tried running it without threading
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论