如何让pyttsx模块的声音变慢

Vag*_* A. 8 python python-module text-to-speech python-3.x pyttsx

我的代码:

import pyttsx3
import random

engine = pyttsx3.init()
words = ['hello', 'word']     
engine.say(random.choice(words)) #Say these words slower
Run Code Online (Sandbox Code Playgroud)

我不希望它变得非常慢,只是慢到足以让非母语人士轻松理解单词列表中的单词。另外,如果使用 pyttsx 模块无法做到这一点,您能否建议一个可以做到这一点的模块?

小智 9

newVoiceRate = 145
engine.setProperty('rate',newVoiceRate)
Run Code Online (Sandbox Code Playgroud)


小智 6

尝试这个:

engine.setProperty('rate', newVoiceRate)
Run Code Online (Sandbox Code Playgroud)

newVoiceRaterate要求更换。它是以每分钟单词数为单位的整数语速。默认为每分钟 200 个字。