run.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:SpeechRecognition-awesomewm 作者: getzneet 项目源码 文件源码
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
   #--------------------------------------------------------------#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号