我怎么改口音?

2024-09-19 03:45:04 发布

您现在位置:Python中文网/ 问答频道 /正文

如何更改pyttsx3中的重音?你知道吗

我已经成功地尝试改变声音和它发表演讲的速度。你知道吗

import pyttsx3
engine=pyttsx3.init()
voice=engine.getProperty('voices')[0]
engine.setProperty('voice',voice.id)
engine.setProperty('rate',100)
engine.say("Hello there!")
engine.runAndWait()  

口音变了。你知道吗


Tags: importid声音hellorateinit速度engine
1条回答
网友
1楼 · 发布于 2024-09-19 03:45:04

您可以尝试以下代码:

import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices')
for voice in voices:
print(voice, voice.id)
engine.setProperty('voice', voice.id)
engine.say("Hello World!")
engine.runAndWait()
engine.stop()

相关问题 更多 >