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

This commit is contained in:
2025-11-08 15:15:24 -08:00
parent 7db0b21015
commit 77571877fa

View File

@@ -6,7 +6,7 @@ print(os.popen('xsel').read()) # In Theory grab selected text and print ot to t
TextToSpeak = os.popen('xsel').read() # In Theory grab selected text into Varible cakked TextToSpeak TextToSpeak = os.popen('xsel').read() # In Theory grab selected text into Varible cakked TextToSpeak
voice = piper.load("path/to/en_US-amy-medium.onnx") # Load the model voice = piper.load("~/en_US-amy-medium.onnx") # Load the model
chunks = voice.synthesize(TextToSpeak) # Set up Piper to stream audio from TextToSpeak chunks = voice.synthesize(TextToSpeak) # Set up Piper to stream audio from TextToSpeak
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