How to lengthen the pause between words with text to speech (pyTTS or SAPI5)

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.

+4
source share
3 answers

You talk about voice speed, right? http://msdn.microsoft.com/en-us/library/ms990078.aspx

Pause () I believe a lot works like a comma in a normal speech pattern ... except that you determine the length (natural or not).

+2
source

I have no great solutions. But:

The latest release of PyTTS was in 2007, and there seems to be no documentation. The same people now support a cross-platform library called pyttsx, which also supports SAPI. It has the meaning of words per minute, but there is no setting to increase the pause between words. This is most likely because there is no pause between the words at all.

You can insert a long pause, making each word your “utterance."

 engine.say('The') engine.say('quick') engine.say('brown') engine.say('fox.') 

instead

 engine.say('The quick brown fox." 

But it is probably too long. In addition to this, you will probably have to wrap or subclass the SAPI driver, but I'm not 100% sure that it works. People do not have pauses between words, so I’m not sure that the speech mechanisms themselves support it.

+2
source

I already did some TTS work using the .NET API. The System.Speech.Synthesis namespace has an enumeration string called PromptBreak, which has different values ​​for the length of the required pause / break: http://msdn.microsoft.com/en-us/library/system.speech.synthesis.promptbreak. aspx

I don’t know how and how it can be used with PyTTS, but perhaps this is the starting point.

0
source

All Articles