Controlling text-to-speech pauses with pyttsx3 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Controlling text-to-speech pauses with pyttsx3 (/thread-36639.html) |
Controlling text-to-speech pauses with pyttsx3 - pmac1300 - Mar-12-2022 I have a list of words that I want Python to turn into speech: import pyttsx3 import time words = ['this','is','my','list'] engine = pyttsx3.init() for i in words: engine.say(i) engine.runAndWait() time.sleep(0)Currently, the time between each word is too long (over a second), even with time.sleep set to 0. Why does the .runAndWait() method even have a built-in wait time and how can this delay be decreased? RE: Controlling text-to-speech pauses with pyttsx3 - menator01 - Mar-13-2022 Instead of looping the list of words, maybe join them. import pyttsx3 words = ['this','is','my','list'] join_words = ' '.join(words) engine = pyttsx3.init() engine.say(join_words) engine.runAndWait() RE: Controlling text-to-speech pauses with pyttsx3 - pmac1300 - Mar-13-2022 Now it is too fast. And changing the 'rate' parameter doesn't help either because it slows down the word too. RE: Controlling text-to-speech pauses with pyttsx3 - BashBedlam - Mar-13-2022 You can create small pauses after each word by inserting commas like this: import pyttsx3 words = ['this,','is,','my,','list'] join_words = ' '.join(words) engine = pyttsx3.init() engine.say(join_words) engine.runAndWait() RE: Controlling text-to-speech pauses with pyttsx3 - Coricoco_fr - Mar-14-2022 Hello, (Mar-13-2022, 04:31 PM)BashBedlam Wrote: You can create small pauses after each word by inserting commas like this: words = ['this','is','my','list'] join_words = ', '.join(words) |