Update Uptated-Prototype/TTS-Script-PiperTTS 2nd.py

This commit is contained in:
2025-12-03 16:08:35 -08:00
parent 4d8664173c
commit 0dedbed35a

View File

@@ -32,7 +32,7 @@ syn_config = SynthesisConfig(
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
'''
try:
result = len(list(chunks))
print(result) # Print the amount of chunks
@@ -42,7 +42,7 @@ 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),