如何解决类型错误模块对象不可调用python gtts
我正在使用gtts,但是当我运行它时,它说:
TypeError 'module' object is not callable
有人知道我应该怎么做吗? 如果有帮助,我在Windows上使用python 3.8.6 非常感谢 这是代码:
import os
from gtts import gTTS
text_to_read = "Hello my name is Alex. What's your name? "
language = 'en'
slow_audio_speed = False
filename = '1.mp3'
def reading_from_string():
audio_created = gTTS(text=text_to_read,lang=language,slow=slow_audio_speed)
audio_created.save(filename)
if platform == "linux":
os.system(f'omxplayer --no-keys {filename}')
elif platform == 'win32':
os.system(f'start {filename}')
else:
print("I am not compatible with your device")
exit()
reading_from_string()
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。