Spaces:
Running
Running
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() |