Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,17 +11,6 @@ def convert_to_mp4_with_aac(input_path, output_path):
|
|
| 11 |
|
| 12 |
return output_path
|
| 13 |
|
| 14 |
-
audio_examples = [
|
| 15 |
-
"German1.wav", "German2.wav", "German3.wav", "German4.wav",
|
| 16 |
-
"acknowledgement_chinese.m4a", "acknowledgement_english.m4a",
|
| 17 |
-
"chinese1_haierlizhi.wav", "chinese2_guanyu.wav",
|
| 18 |
-
"french1.wav", "french2.wav", "french3.wav",
|
| 19 |
-
"italian1.wav", "italian2.wav", "italian3.wav",
|
| 20 |
-
"japan1.wav", "japan2.wav", "japan3.wav",
|
| 21 |
-
"korean1.wav", "korean2.wav", "korean3.wav",
|
| 22 |
-
"noisy_audio_cafeter_snr_0.wav", "noisy_audio_meeting_snr_0.wav", "noisy_audio_meeting_snr_10.wav", "noisy_audio_meeting_snr_20.wav", "noisy_audio_narrative.wav", "noisy_audio_office_snr_0.wav", "out_of_domain_narrative.wav",
|
| 23 |
-
"spanish1.wav", "spanish2.wav", "spanish3.wav"
|
| 24 |
-
]
|
| 25 |
|
| 26 |
# Function to check if the audio file path exists in the list
|
| 27 |
def check_file_exists(file_path, audio_list):
|
|
@@ -31,14 +20,7 @@ def load_audio(audio_listed):
|
|
| 31 |
if audio_listed is None:
|
| 32 |
return None
|
| 33 |
else:
|
| 34 |
-
|
| 35 |
-
print(f"The file {audio_listed} exists in the list.")
|
| 36 |
-
return f"data/audio/{audio_listed}"
|
| 37 |
-
|
| 38 |
-
else:
|
| 39 |
-
print(f"The file {audio_listed} does not exist in the list.")
|
| 40 |
-
return f"{audio_listed}"
|
| 41 |
-
|
| 42 |
|
| 43 |
def execute_command(command: str) -> None:
|
| 44 |
subprocess.run(command, check=True)
|
|
@@ -111,7 +93,17 @@ with gr.Blocks(css=css) as demo:
|
|
| 111 |
with gr.Row():
|
| 112 |
audio_list = gr.Dropdown(
|
| 113 |
label="Choose an audio (optional)",
|
| 114 |
-
choices=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
value = "acknowledgement_english.m4a"
|
| 116 |
)
|
| 117 |
audio_list.change(
|
|
|
|
| 11 |
|
| 12 |
return output_path
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Function to check if the audio file path exists in the list
|
| 16 |
def check_file_exists(file_path, audio_list):
|
|
|
|
| 20 |
if audio_listed is None:
|
| 21 |
return None
|
| 22 |
else:
|
| 23 |
+
return f"data/audio/{audio_listed}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
def execute_command(command: str) -> None:
|
| 26 |
subprocess.run(command, check=True)
|
|
|
|
| 93 |
with gr.Row():
|
| 94 |
audio_list = gr.Dropdown(
|
| 95 |
label="Choose an audio (optional)",
|
| 96 |
+
choices=[
|
| 97 |
+
"German1.wav", "German2.wav", "German3.wav", "German4.wav",
|
| 98 |
+
"acknowledgement_chinese.m4a", "acknowledgement_english.m4a",
|
| 99 |
+
"chinese1_haierlizhi.wav", "chinese2_guanyu.wav",
|
| 100 |
+
"french1.wav", "french2.wav", "french3.wav",
|
| 101 |
+
"italian1.wav", "italian2.wav", "italian3.wav",
|
| 102 |
+
"japan1.wav", "japan2.wav", "japan3.wav",
|
| 103 |
+
"korean1.wav", "korean2.wav", "korean3.wav",
|
| 104 |
+
"noisy_audio_cafeter_snr_0.wav", "noisy_audio_meeting_snr_0.wav", "noisy_audio_meeting_snr_10.wav", "noisy_audio_meeting_snr_20.wav", "noisy_audio_narrative.wav", "noisy_audio_office_snr_0.wav", "out_of_domain_narrative.wav",
|
| 105 |
+
"spanish1.wav", "spanish2.wav", "spanish3.wav"
|
| 106 |
+
],
|
| 107 |
value = "acknowledgement_english.m4a"
|
| 108 |
)
|
| 109 |
audio_list.change(
|