Is it possible to widen the gap between spoken words when using text-to-speech with SAPI5?
The problem is that esp. with some voices, the words are almost related to each other, which makes it difficult to understand speech.
I am using the python module and pyTTS (on windows since it uses SAPI)
I tried to connect to the OnWord event and add time.sleep () or tts.Pause (), but apparently, despite the fact that all events are caught, they are processed only at the end of the oral text, regardless of whether I use the synchronization flag or asynchronization.
In this NON WORKING example, the sleep () method only executes after the sentence is pronounced:
tts = pyTTS.Create() def f(x): tts.Pause() sleep(0.5) tts.Resume() tts.OnWord = f tts.Speak(text)
Edit: - decisions taken
The actual answers for me were either
- saying every word in your own “speak” command (suggested by @Lennart Regebro) or
replacing each space with a comma (as @Dawson mentioned) e.g.
text = text.replace (",", ")
which sets a reasonable pause. I did not investigate the Pause method more than I mentioned above, because "I am satisfied with the decisions made.
source share