Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -857,7 +857,8 @@ def sound_separate(media_file, stem, main, dereverb, vocal_effects=True, backgro
|
|
| 857 |
background_highpass_freq=120, background_lowpass_freq=11000,
|
| 858 |
background_reverb_room_size=0.5, background_reverb_damping=0.5, background_reverb_wet_level=0.25,
|
| 859 |
background_compressor_threshold_db=-20, background_compressor_ratio=2.5, background_compressor_attack_ms=15, background_compressor_release_ms=80,
|
| 860 |
-
background_gain_db=3
|
|
|
|
| 861 |
if not media_file:
|
| 862 |
raise ValueError("The audio path is missing.")
|
| 863 |
|
|
@@ -869,6 +870,12 @@ def sound_separate(media_file, stem, main, dereverb, vocal_effects=True, backgro
|
|
| 869 |
|
| 870 |
outputs = []
|
| 871 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 872 |
start_time = time.time()
|
| 873 |
|
| 874 |
if stem == "vocal":
|
|
@@ -896,6 +903,7 @@ def sound_separate(media_file, stem, main, dereverb, vocal_effects=True, backgro
|
|
| 896 |
|
| 897 |
outputs.append(vocal_audio)
|
| 898 |
except Exception as error:
|
|
|
|
| 899 |
logger.error(str(error))
|
| 900 |
|
| 901 |
if stem == "background":
|
|
@@ -933,7 +941,7 @@ def sound_separate(media_file, stem, main, dereverb, vocal_effects=True, backgro
|
|
| 933 |
|
| 934 |
|
| 935 |
def audio_downloader(
|
| 936 |
-
|
| 937 |
):
|
| 938 |
|
| 939 |
url_media = url_media.strip()
|
|
|
|
| 857 |
background_highpass_freq=120, background_lowpass_freq=11000,
|
| 858 |
background_reverb_room_size=0.5, background_reverb_damping=0.5, background_reverb_wet_level=0.25,
|
| 859 |
background_compressor_threshold_db=-20, background_compressor_ratio=2.5, background_compressor_attack_ms=15, background_compressor_release_ms=80,
|
| 860 |
+
background_gain_db=3,
|
| 861 |
+
):
|
| 862 |
if not media_file:
|
| 863 |
raise ValueError("The audio path is missing.")
|
| 864 |
|
|
|
|
| 870 |
|
| 871 |
outputs = []
|
| 872 |
|
| 873 |
+
try:
|
| 874 |
+
duration_base_ = librosa.get_duration(filename=media_file)
|
| 875 |
+
print("Duration audio:", duration_base_)
|
| 876 |
+
except Exception as e:
|
| 877 |
+
print(e)
|
| 878 |
+
|
| 879 |
start_time = time.time()
|
| 880 |
|
| 881 |
if stem == "vocal":
|
|
|
|
| 903 |
|
| 904 |
outputs.append(vocal_audio)
|
| 905 |
except Exception as error:
|
| 906 |
+
gr.Info(str(error))
|
| 907 |
logger.error(str(error))
|
| 908 |
|
| 909 |
if stem == "background":
|
|
|
|
| 941 |
|
| 942 |
|
| 943 |
def audio_downloader(
|
| 944 |
+
url_media,
|
| 945 |
):
|
| 946 |
|
| 947 |
url_media = url_media.strip()
|