Spaces:
Running
Running
Update vc.py
Browse files
vc.py
CHANGED
@@ -10,8 +10,11 @@ uid = uuid.uuid4()
|
|
10 |
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
|
13 |
-
def custom_bark(inp, in_aud, trim_aud=None):
|
14 |
-
|
|
|
|
|
|
|
15 |
if trim_aud != None:
|
16 |
speaker_wav=Path(f"{uid}-trim.wav")
|
17 |
tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False).to(device)
|
@@ -64,13 +67,13 @@ with gr.Blocks() as app:
|
|
64 |
with gr.Column():
|
65 |
in_aud_yt = gr.Textbox(label="YouTube URL")
|
66 |
load_yt_btn = gr.Button("Load URL")
|
67 |
-
yt_vid = gr.Video(
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
load_yt_btn.click(load_video_yt, in_aud_yt, [yt_vid,in_aud_file,aud_file])
|
73 |
trim_clip_btn.click(trim_clip,[aud_file, start_time, end_time],trim_aud)
|
74 |
-
alt_go_btn.click(custom_bark, [in_text,in_aud_file,trim_aud], out_audio)
|
75 |
|
76 |
app.launch()
|
|
|
10 |
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
|
13 |
+
def custom_bark(inp, in_aud=None, trim_aud=None, in_aud_mic=None):
|
14 |
+
if in_aud_mic != None:
|
15 |
+
speaker_wav=in_aud_mic
|
16 |
+
if in_aud !=None:
|
17 |
+
speaker_wav=Path(f"{uid}-tmp_aud.mp4")
|
18 |
if trim_aud != None:
|
19 |
speaker_wav=Path(f"{uid}-trim.wav")
|
20 |
tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar=False).to(device)
|
|
|
67 |
with gr.Column():
|
68 |
in_aud_yt = gr.Textbox(label="YouTube URL")
|
69 |
load_yt_btn = gr.Button("Load URL")
|
70 |
+
yt_vid = gr.Video(interactive=False)
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
load_yt_btn.click(load_video_yt, in_aud_yt, [yt_vid,in_aud_file,aud_file])
|
76 |
trim_clip_btn.click(trim_clip,[aud_file, start_time, end_time],trim_aud)
|
77 |
+
alt_go_btn.click(custom_bark, [in_text,in_aud_file,trim_aud, in_aud_mic], out_audio)
|
78 |
|
79 |
app.launch()
|