import streamlit as st import torch from tts.api import TTS import os os.environ["COQUI_TOS_AGREED"] = "1" device = "cpu" tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device) def clone(text, audio='Abby_Cadabby.m4a'): tts.tts_to_file(text=text, speaker_wav=audio, language="en", file_path="./output.wav") return "./output.wav" st.title('Abby Cadabby Voice Clone') st.write("""Abby Cadabby voice clone using coqui-TTS. Please ✨ this Space. """) text = st.text_input('Text', 'Type in whatever you would like me to say.') if st.button('Generate Audio'): audio_file = clone(text) st.audio(audio_file)