added chatgpt wrap, tts phone number splitting

This commit is contained in:
Looki2000
2023-12-02 17:32:01 +01:00
parent f18e41476f
commit 24f909abff
5 changed files with 129 additions and 11 deletions

View File

@@ -78,6 +78,9 @@ class TTSStream:
def tts_speak(self, text):
self.play_buffer_size = 512
# separate long sequences of numbers in text string (for example 123456789) into packets of 3 (123 456 789)
text = re.sub(r"(\d{3})(?=\d)", r"\1 ", text)
# open pyaudio stream
p = pyaudio.PyAudio()