【发布时间】:2017-06-29 16:55:01
【问题描述】:
from gtts import gTTS
import os
import subprocess
tts = gTTS(text='Hello World', lang='en') //TEXT TO SPEECH
tts.save("audio.mp3") //Hello world will be saved in audio.mp3
os.system("mpg321 audio.mp3") <-- I want to play the audio file in python(not to call any other music player)
我想播放 audio.mp3 文件,但没有任何反应(cmd 出现并在 1 秒后消失)
【问题讨论】:
-
命令名是mpg123,不是mp321。而且它只存在于 Linux 上。
标签: python audio speech-recognition