-1

I am making an application that requires sound, and when I am trying to play the sound, I keep getting this error:

Error 263 for command: open audio1750892060.mp3 The specified device is not open or is not recognized by MCI.

And these are the lines of code causing the error:

def speak(audio_string):
    tts = gTTS(text=audio_string, lang='en')
    r = random.randint(1, 5000000000)
    audio_file = 'audio' + str(r) + '.mp3'
    tts.save(audio_file)
    playsound.playsound(audio_file)
    print(audio_string)
    os.remove(audio_file)
4

1 回答 1

1

折腾了几分钟后,我使用 Pygame 模块播放声音,它奏效了!

于 2021-08-20T17:07:37.217 回答