Audio examples variable change
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ def convert_to_mp4_with_aac(input_path, output_path):
|
|
11 |
|
12 |
return output_path
|
13 |
|
14 |
-
|
15 |
"German1.wav", "German2.wav", "German3.wav", "German4.wav",
|
16 |
"acknowledgement_chinese.m4a", "acknowledgement_english.m4a",
|
17 |
"chinese1_haierlizhi.wav", "chinese2_guanyu.wav",
|
@@ -31,7 +31,7 @@ def load_audio(audio_listed):
|
|
31 |
if audio_listed is None:
|
32 |
return None
|
33 |
else:
|
34 |
-
if check_file_exists(audio_listed,
|
35 |
print(f"The file {audio_listed} exists in the list.")
|
36 |
return f"data/audio/{audio_listed}"
|
37 |
|
@@ -111,7 +111,7 @@ 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 |
+
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",
|
|
|
31 |
if audio_listed is None:
|
32 |
return None
|
33 |
else:
|
34 |
+
if check_file_exists(audio_listed, audio_examples):
|
35 |
print(f"The file {audio_listed} exists in the list.")
|
36 |
return f"data/audio/{audio_listed}"
|
37 |
|
|
|
111 |
with gr.Row():
|
112 |
audio_list = gr.Dropdown(
|
113 |
label="Choose an audio (optional)",
|
114 |
+
choices=audio_examples,
|
115 |
value = "acknowledgement_english.m4a"
|
116 |
)
|
117 |
audio_list.change(
|