Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,10 +37,10 @@ def create_vc_fn(tgt_sr, net_g, vc, if_f0, file_index, file_big_npy):
|
|
37 |
if tts_text is None or tts_voice is None:
|
38 |
return "You need to enter text and select a voice", None
|
39 |
asyncio.run(edge_tts.Communicate(tts_text, "-".join(tts_voice.split('-')[:-1])).save("tts.mp3"))
|
40 |
-
audio, sr = librosa.load("tts.mp3", sr=
|
41 |
else:
|
42 |
if args.files:
|
43 |
-
audio, sr = librosa.load(input_audio, sr=
|
44 |
else:
|
45 |
if input_audio is None:
|
46 |
return "You need to upload an audio", None
|
@@ -185,4 +185,4 @@ if __name__ == '__main__':
|
|
185 |
vc_output2 = gr.Audio(label="Output Audio")
|
186 |
vc_submit.click(vc_fn, [vc_input, vc_transpose, vc_f0method, vc_index_ratio, tts_mode, tts_text, tts_voice], [vc_output1, vc_output2])
|
187 |
tts_mode.change(change_to_tts_mode, [tts_mode], [vc_input, tts_text, tts_voice])
|
188 |
-
app.queue(concurrency_count=1, max_size=20, api_open=args.api).launch(share=args.share)
|
|
|
37 |
if tts_text is None or tts_voice is None:
|
38 |
return "You need to enter text and select a voice", None
|
39 |
asyncio.run(edge_tts.Communicate(tts_text, "-".join(tts_voice.split('-')[:-1])).save("tts.mp3"))
|
40 |
+
audio, sr = librosa.load("tts.mp3", sr=48000, mono=True)
|
41 |
else:
|
42 |
if args.files:
|
43 |
+
audio, sr = librosa.load(input_audio, sr=48000, mono=True)
|
44 |
else:
|
45 |
if input_audio is None:
|
46 |
return "You need to upload an audio", None
|
|
|
185 |
vc_output2 = gr.Audio(label="Output Audio")
|
186 |
vc_submit.click(vc_fn, [vc_input, vc_transpose, vc_f0method, vc_index_ratio, tts_mode, tts_text, tts_voice], [vc_output1, vc_output2])
|
187 |
tts_mode.change(change_to_tts_mode, [tts_mode], [vc_input, tts_text, tts_voice])
|
188 |
+
app.queue(concurrency_count=1, max_size=20, api_open=args.api, status_update_rate=10).launch(share=args.share)
|