def play_answer(self, action, software=None, text=None):
if software:
if not path.isfile("answers/{}_{}.mp3".format(action, software)):
tts = gTTS(
text="Très bien, je {} {}...".format(action, software), lang="fr")
tts.save("answers/{}_{}.mp3".format(action, software))
notify("Alexa: Très bien, je {} {} ... ".format(
action, software), self.icon)
Popen(["mplayer", "answers/{}_{}.mp3".format(action, software)])
else:
if not path.isfile("answers/{}.mp3".format(action)):
tts = gTTS(text=text, lang="fr")
tts.save("answers/{}.mp3".format(action))
notify("Alexa: {}".format(text), self.icon)
call(["mplayer", "answers/{}.mp3".format(action)])
self.end = True
#--------------------------------------------------------------#
评论列表
文章目录