python.py 文件源码

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

项目:jenova 作者: dungba88 项目源码 文件源码
def speak_text(self, text):
        """Speak a single text"""
        from gtts import gTTS
        tts = gTTS(text=text, lang=self.lang)
        # save the speech to temp file
        tmp_file = NamedTemporaryFile()
        tts.write_to_fp(tmp_file)
        # play it with pyaudio
        from utils.ev3 import audio
        audio.play(tmp_file.name)
        # remove it
        tmp_file.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号