aigmixer's picture
Update app.py
924e172
raw
history blame
570 Bytes
import gradio as gr
import subprocess
def synthesize_text(text):
# Replace 'piper_cli_script.py' with the path to your Piper CLI script
command = ['python', '/piper/__main__.py', '--model', 'https://huggingface.co/rhasspy/piper-voices/blob/v1.0.0/en/en_GB/alan/medium/en_GB-alan-medium.onnx', '--text', text]
result = subprocess.run(command, capture_output=True, text=True)
# Handle result and output file path
return '/path_to_output_audio.wav'
iface = gr.Interface(
fn=synthesize_text,
inputs="text",
outputs="audio"
)
iface.launch()