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, title = "🎤Voice cloner", description = "Record your voice or any other voice, input the text that you want to be spoken using the reference voice and voilà !", inputs = [gr.Textbox(label= "Text to speak", placeholder = "Your text to speech here"), gr.Audio(label= "Audio to clone", sources = ["microphone"], type = "filepath")], outputs = [gr.Audio(label = "File path")] , allow_flagging = "never") if __name__ == '__main__': interface.launch()