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

This commit is contained in:
2025-12-03 15:47:06 -08:00
parent 615f4fe9b2
commit 7838a76108

View File

@@ -29,10 +29,13 @@ syn_config = SynthesisConfig(
) )
chunks = voice.synthesize(texttospeak, syn_config=syn_config) # Set up Piper to stream audio from TextToSpeak chunks = voice.synthesize(texttospeak, syn_config=syn_config) # Set up Piper to stream audio from TextToSpeak
#Lenght = len(list(chunks))
#print(f"There are {Lenght} Chunks.") # Print the amount of chunks
first_chunk = next(chunks) # Get the first chunk to set up audio stream configuration first_chunk = next(chunks) # Get the first chunk to set up audio stream configuration
try:
print(len(list(chunks))) # Print the amount of chunks
except:
print("Failed getting Chunk Count")
try: try:
print(first_chunk.sample_rate) print(first_chunk.sample_rate)
except: except: