python文本转语音_Python中的文本到语音模型

python文本转语音

Text to speech model is a small application or bot which converts the given text into speech.

文本到语音模型是将给定文本转换为语音的小型应用程序或漫游器。

The module that we use for text to speech conversion: pyttsx3

我们用于文本到语音转换的模块: pyttsx3

pyttsx3 is a text-to-speech conversion library in Python. It is very easy to use tool which converts the entered text into speech.

pyttsx3是Python中的文本到语音转换库。 这是非常容易使用的工具,可以将输入的文本转换为语音。

Download the module:

下载模块:

pip install pyttsx3 (In your terminal or command prompt)

If you are using Pycharm User: Go to the project interpreter and install the module.

如果您使用的是Pycharm用户:转到项目解释器并安装模块。

The various functions that we will use in this model are,

我们将在此模型中使用的各种功能是:

  • engine=pyttsx3.init(): The init function is the main function, we have to use this function every time. This function initializes the connection and creates an engine and we can perform all the things on the engine created by the .init() function

    engine = pyttsx3.init() :init函数是主要函数,我们必须每次都使用此函数。 该函数初始化连接并创建引擎,我们可以在由.init()函数创建的引擎上执行所有操作

  • engine.say(text): This function will convert the text to speech (text is the input from the user)

    engine.say(text) :此函数会将文本转换为语音(文本是用户的输入)

  • engine.runAndWait(): This function will make the speech audible in the system, if you don't write this command then the speech will not be audible to you.

    engine.runAndWait() :此函数将使语音在系统中可听见,如果您不编写此命令,则您将听不到语音。

  • engine.setProperty(): This method sets different properties of the model.

    engine.setProperty(

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值