voice-cloner / app.py
mboushaba's picture
Upload 4 files
f6bbb30 verified
raw
history blame
508 Bytes
import gradio as gr
from coqui_tts import CoquiTTS
def speech(text, audio):
coqui_tts = CoquiTTS(speaker_wave_file = audio)
return coqui_tts.speech_text_and_save_it(text, "output.wav")
interface = gr.Interface(
fn = speech,
inputs = [gr.Textbox(placeholder = "Your text to speech here"),
gr.Audio(sources = ["microphone"], type = "filepath")],
outputs = [gr.Audio(label = "File path")]
, allow_flagging = "never")
if __name__ == '__main__':
interface.launch()