파이썬에서 The driver cannot recognize the specified command parameter 에러 해결방법

Asked 5 months ago, Updated 5 months ago, 250 views

아래 코드처럼 playsound를 이용하려는데요.

from playsound import playsound

playsound("1.mp3")

 

그러면 아래와 같이 에러가 납니다.

    Error 259 for command:
        play 1.mp3 wait
    The driver cannot recognize the specified command parameter.

    Error 263 for command:
        close 1.mp3
    The specified device is not open or is not recognized by MCI.
Failed to close the file: 1.mp3
Traceback (most recent call last):
  File "C:\Users\test\OneDrive\Desktop\Python\test.py", line 4, in <module>
    playsound("1.mp3")
  File "C:\Users\test\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\playsound.py", line 73, in _playsoundWin
    winCommand(u'play {}{}'.format(sound, ' wait' if block else ''))
  File "C:\Users\test\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\playsound.py", line 64, in winCommand
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
    Error 259 for command:
        play 1.mp3 wait
    The driver cannot recognize the specified command parameter. 

 

어떻게 해결하면 될까요? 

python

2022-06-12 06:21

1 Answers

아래처럼 playsound를 설치해서 해결했습니다.

pip install playsound==1.2.2


2022-06-12 06:23

If you have any answers or tips


© 2022 pinfo. All rights reserved.