Spaces:
No application file
No application file
Download App.py from LilOnedaone74/Openvoiceclone: direct link, hf CLI and curl.
- Browser
- Download file 653 Bytes
-
https://huggingface.co/spaces/LilOnedaone74/Openvoiceclone/resolve/main/App.py
- Command line
-
hf download hf://spaces/LilOnedaone74/Openvoiceclone/App.py
-
curl -L -o App.py https://huggingface.co/spaces/LilOnedaone74/Openvoiceclone/resolve/main/App.py
653 Bytes
| import gradio as gr | |
| from TTS.api import TTS | |
| tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2") | |
| def clone_voice(text, audio): | |
| output_path = "output.wav" | |
| tts.tts_to_file( | |
| text=text, | |
| speaker_wav=audio, | |
| language="en", | |
| file_path=output_path | |
| ) | |
| return output_path | |
| ui = gr.Interface( | |
| fn=clone_voice, | |
| inputs=[ | |
| gr.Textbox(label="Text to Speak"), | |
| gr.Audio(type="filepath", label="Upload Your Voice Sample") | |
| ], | |
| outputs=gr.Audio(label="Cloned Voice Output"), | |
| title="Open Voice Clone", | |
| description="Only upload voices you own or have permission to use." | |
| ) | |
| ui.launch() |