nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
2.09k stars 330 forks source link

How to remove pauses between completions #294

Closed deezed420 closed 1 week ago

deezed420 commented 11 months ago

How do I remove the pauses after every completion? I am trying to make the engine say stuff from a ChatGPT streaming API but that pause between each completion removes the fluency and makes it basically unusable. I can't just join them into a sentence because the ChatGPT streaming API takes a while for big completions. Here is what I have tried:

import pyttsx3

words = ['this,','is,','my,','list']
join_words = ' '.join(words)
engine = pyttsx3.init()
engine.say(join_words)
engine.runAndWait()

but this gives very jagged pauses between the words

willwade commented 1 week ago

remove your commas. SAPI/NSSS will always put a timing gap in with the commas. Just like you'd expect in natural speech.

i.e.

import pyttsx3

words = ['this','is','my','list']
join_words = ' '.join(words)
engine = pyttsx3.init()
engine.say(join_words)
engine.runAndWait()