Spaces:
Runtime error
Runtime error
Update vc.py
Browse files
vc.py
CHANGED
@@ -11,7 +11,11 @@ test_audio="./shufflin.wav"
|
|
11 |
|
12 |
uid = uuid.uuid4()
|
13 |
device="cpu"
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
|
16 |
def custom_bark(inp, tog, in_aud=None, trim_aud=None, in_aud_mic=None):
|
17 |
if tog=="Custom":
|
@@ -26,7 +30,7 @@ def custom_bark(inp, tog, in_aud=None, trim_aud=None, in_aud_mic=None):
|
|
26 |
tts.tts_to_file(inp, speaker_wav=speaker_wav, language="en", file_path=f"{uid}-output.wav")
|
27 |
return (f"{uid}-output.wav")
|
28 |
if tog=="Preset":
|
29 |
-
return (
|
30 |
def load_video_yt(vid):
|
31 |
yt = YouTube(vid)
|
32 |
vid = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename=f"{uid}-tmp.mp4")
|
|
|
11 |
|
12 |
uid = uuid.uuid4()
|
13 |
device="cpu"
|
14 |
+
def run_tts(text, s_g="ljspeech", s_s="fast_pitch"):
|
15 |
+
tts = TTS(model_name=f"tts_models/en/{s_g}/{s_s}", progress_bar=False).to("cpu")
|
16 |
+
uid=uuid.uuid4()
|
17 |
+
tts.tts_to_file(text, file_path=f"{uid}-output.wav")
|
18 |
+
return (f'{uid}-output.wav')
|
19 |
|
20 |
def custom_bark(inp, tog, in_aud=None, trim_aud=None, in_aud_mic=None):
|
21 |
if tog=="Custom":
|
|
|
30 |
tts.tts_to_file(inp, speaker_wav=speaker_wav, language="en", file_path=f"{uid}-output.wav")
|
31 |
return (f"{uid}-output.wav")
|
32 |
if tog=="Preset":
|
33 |
+
return (run_tts(inp))
|
34 |
def load_video_yt(vid):
|
35 |
yt = YouTube(vid)
|
36 |
vid = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename=f"{uid}-tmp.mp4")
|