Update app.py
Browse files
app.py
CHANGED
@@ -35,8 +35,10 @@ def voice_conversion(input_audio, target_voice, uploaded_target_voice):
|
|
35 |
# Check audio duration (always enforce the 2-minute limit)
|
36 |
duration = librosa.get_duration(filename=input_audio)
|
37 |
if duration > 120:
|
38 |
-
print("Error: Audio file exceeds 2 minutes.")
|
39 |
-
|
|
|
|
|
40 |
|
41 |
# Check if the user uploaded a target voice, otherwise use selected from examples
|
42 |
if uploaded_target_voice is not None:
|
@@ -107,4 +109,5 @@ with gr.Blocks() as demo:
|
|
107 |
)
|
108 |
|
109 |
# Launch with public=True for public URL access and share link
|
110 |
-
demo.launch(share=True)
|
|
|
|
35 |
# Check audio duration (always enforce the 2-minute limit)
|
36 |
duration = librosa.get_duration(filename=input_audio)
|
37 |
if duration > 120:
|
38 |
+
print("Error: Input Audio file exceeds 2 minutes.")
|
39 |
+
raise gr.Error("Error: Input Audio file exceeds 2 minutes.")
|
40 |
+
elif duration > 30:
|
41 |
+
gr.Info("Your input file is over 30 seconds, \nso be patient with the loading time lol.")
|
42 |
|
43 |
# Check if the user uploaded a target voice, otherwise use selected from examples
|
44 |
if uploaded_target_voice is not None:
|
|
|
109 |
)
|
110 |
|
111 |
# Launch with public=True for public URL access and share link
|
112 |
+
#demo.launch(share=True)
|
113 |
+
demo.queue().launch(share=True)
|