Python Playsound Error: The driver cannot recognize the specified command

Posted in :

使用 python 播放聲音,目前找到較佳解法,除了使用 pyQT 之外,最方便的就是 playsound. 很神奇在 Windows 平台會顯示錯誤訊息:


The driver cannot recognize the specified command


Run this in CMD or any such terminal:

pip install playsound==1.2.2

Downgrading the version works perfectly

先用platform 檢查,如果 Windows 平台,如果又是播放 wav 格式,遇到錯誤是,可以試看看切換到其他的套件來播放音效:

其他解法:Playing mp3 song on python

Grab the VLC Python module,, which provides full support for libVLC and pop that in site-packages. Then:

>>> import vlc
>>> p = vlc.MediaPlayer("file:///path/to/track.mp3")

And you can stop it with:

>>> p.stop()

from pygame import mixer  # Load the popular external library

mixer.init()'e:/LOCAL/Betrayer/Metalik Klinik1-Anak Sekolah.mp3')


import subprocess

def play_mp3(path):
    subprocess.Popen(['mpg123', '-q', path]).wait()


def play(audio_file_path):["ffplay", "-nodisp", "-autoexit", "/Users/me/Downloads/sample.wav"])


發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *