How to make pyttsx module's voice go slower

14.7k views Asked by At

My code:

import pyttsx3
import random

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

I don't want it to go really slow just slow enough to be easy for a non native speaker to undersatnd the words in the words list. Also if it is impossible to do it using the pyttsx module can you suggest a module that can do that?

4

There are 4 answers

0
AudioBubble On

To make the voice go slower in pyttsx3 you can just do:

import pyttsx3   

text = "Hello"
 
engine = pyttsx3.init()
engine.setProperty("rate", rate)
engine.say(text)
engine.runAndWait()

0
Rahul Vansh On

Try this:

engine.setProperty('rate', newVoiceRate)

Replace newVoiceRate with rate according to requirement. It's integer speech rate in words per minute. Defaults to 200 word per minute.

2
Sarborup Sarkar On
newVoiceRate = 145
engine.setProperty('rate',newVoiceRate)
3
Harish R On

First We Have To Make A Variable Which defines the rate of speed the engine have to speak the (engine.setProperty) sets The Property of the rate to the variable (newVoiceRate) By That You Can change The Speed of speaking speed of the engine. I have Also Edited your codes and implied the changes. See below Try This

 import pyttsx3
 import random

 engine = pyttsx3.init()
 words = ['hello', 'word']     
 engine.say(random.choice(words))
 newVoiceRate = 145
 engine.setProperty('rate',newVoiceRate)