google.py 文件源码

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

项目:PyText2Speech 作者: PyText2Speech 项目源码 文件源码
def speech(self, narration, lang, voice=None, **kwargs):
        """
        Returns the get HTTP response by doing a GET to
        /v1/synthesize with text, voice, accept
        """

        resp = gTTS(text=narration, lang=lang)
        resp.save('/tmp/google.mp3')

        content = open('/tmp/google.mp3', 'rb').read()

        return content, 'mp3'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号