类型错误模块对象不可调用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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...