aigmixer
updating app.py
f69f274
raw
history blame
436 Bytes
import gradio as gr
import subprocess
import piper
def synthesize_speech(text):
# Command to execute Piper-TTS CLI
command = ['piper', '--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()