From 1ec9200bfc5fde1965d7e28f06f1d7602688b0b4 Mon Sep 17 00:00:00 2001 From: "DHR.Mike" Date: Wed, 3 Dec 2025 08:34:31 -0800 Subject: [PATCH] Update Uptated-Prototype/TTS-Script-PiperTTS 2nd.py --- ...Script-PiperTTS.py => TTS-Script-PiperTTS 2nd.py} | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) rename Uptated-Prototype/{TTS-Script-PiperTTS.py => TTS-Script-PiperTTS 2nd.py} (78%) diff --git a/Uptated-Prototype/TTS-Script-PiperTTS.py b/Uptated-Prototype/TTS-Script-PiperTTS 2nd.py similarity index 78% rename from Uptated-Prototype/TTS-Script-PiperTTS.py rename to Uptated-Prototype/TTS-Script-PiperTTS 2nd.py index 2ea50a7..0e563d4 100644 --- a/Uptated-Prototype/TTS-Script-PiperTTS.py +++ b/Uptated-Prototype/TTS-Script-PiperTTS 2nd.py @@ -18,8 +18,16 @@ print(texttospeak) voicedir = os.path.expanduser('~') #Where onnx model files are stored on my machine model = voicedir+"/en_GB-alba-medium.onnx" voice = PiperVoice.load(model) - -chunks = voice.synthesize(texttospeak) # Set up Piper to stream audio from TextToSpeak + +syn_config = SynthesisConfig( + volume=0.5, # half as loud + length_scale=2.0, # twice as slow + noise_scale=0.0, # more audio variation + noise_w_scale=0.0, # more speaking variation + normalize_audio=False, # use raw audio from voice +) + +chunks = voice.synthesize(texttospeak, syn_config=syn_config) # Set up Piper to stream audio from TextToSpeak first_chunk = next(chunks) # Get the first chunk to set up audio stream configuration p = pyaudio.PyAudio()