From b97ee3d3775342481a2845cd2129a24c80752b52 Mon Sep 17 00:00:00 2001 From: "DHR.Mike" Date: Sun, 16 Nov 2025 09:18:29 -0800 Subject: [PATCH] Update Uptated-Prototype/TTS-Script-PiperTTS.py --- Uptated-Prototype/TTS-Script-PiperTTS.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Uptated-Prototype/TTS-Script-PiperTTS.py b/Uptated-Prototype/TTS-Script-PiperTTS.py index 5150cfa..9d905b6 100644 --- a/Uptated-Prototype/TTS-Script-PiperTTS.py +++ b/Uptated-Prototype/TTS-Script-PiperTTS.py @@ -4,8 +4,11 @@ import pyaudio import os import subprocess -texttospeak = subprocess.Popen(["xsel"], text=True) -print(texttospeak) +result = subprocess.Popen(["xsel"], text=True) +print(result) + +texttospeak = str(result) + # texttospeak = "Welcome to the world of speech synthesis! This is an example of text-to-speech using Piper TTS." @@ -15,7 +18,7 @@ voicedir = os.path.expanduser('~') #Where onnx model files are stored on my mach model = voicedir+"/en_GB-alba-medium.onnx" voice = PiperVoice.load(model) -chunks = voice.synthesize(str(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 p = pyaudio.PyAudio()