import gradio as gr import subprocess import piper def synthesize_speech(text): # Command to execute Piper-TTS CLI command = ['piper-tts-cli', '--text', text, '--output', 'output.wav'] subprocess.run(command, capture_output=True) if os.path.exists('output.wav'): return 'output.wav' else: return None iface = gr.Interface( fn=synthesize_speech, inputs='text', outputs='audio' ) iface.launch()