From ab113c63966b5fe49d461760066777d8a8c981c8 Mon Sep 17 00:00:00 2001 From: "DHR.Mike" Date: Wed, 3 Dec 2025 12:53:11 -0800 Subject: [PATCH] Update Uptated-Prototype/TTS-Script-PiperTTS 2nd.py --- Uptated-Prototype/TTS-Script-PiperTTS 2nd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Uptated-Prototype/TTS-Script-PiperTTS 2nd.py b/Uptated-Prototype/TTS-Script-PiperTTS 2nd.py index 978388a..c309970 100644 --- a/Uptated-Prototype/TTS-Script-PiperTTS 2nd.py +++ b/Uptated-Prototype/TTS-Script-PiperTTS 2nd.py @@ -29,8 +29,14 @@ syn_config = SynthesisConfig( ) chunks = voice.synthesize(texttospeak, syn_config=syn_config) # Set up Piper to stream audio from TextToSpeak +print(f"There are {len(chunks)} Chunks.") # Print the amount of chunks first_chunk = next(chunks) # Get the first chunk to set up audio stream configuration +try: + print(first_chunk.sample_rate) +except: + print("Failed getting sample rate?") + p = pyaudio.PyAudio() stream = p.open( # Open audio stream with correct settings format=p.get_format_from_width(first_chunk.sample_width),