fffiloni commited on
Commit
c42d6a9
1 Parent(s): 06a5b99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py CHANGED
@@ -11,6 +11,9 @@ def convert_to_mp4_with_aac(input_path, output_path):
11
 
12
  return output_path
13
 
 
 
 
14
  def execute_command(command: str) -> None:
15
  subprocess.run(command, check=True)
16
 
@@ -46,6 +49,25 @@ with gr.Blocks() as demo:
46
  with gr.Column():
47
  image_path = gr.Image(label="Image", type="filepath", sources=["upload"])
48
  audio_input = gr.Audio(label="Audio input", type="filepath", sources=["upload"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  run_btn = gr.Button("Run")
50
  with gr.Column():
51
  output_video = gr.Video(format="mp4")
 
11
 
12
  return output_path
13
 
14
+ def load_audio(audio_listed):
15
+ return f"data/audio/{audio_listed}"
16
+
17
  def execute_command(command: str) -> None:
18
  subprocess.run(command, check=True)
19
 
 
49
  with gr.Column():
50
  image_path = gr.Image(label="Image", type="filepath", sources=["upload"])
51
  audio_input = gr.Audio(label="Audio input", type="filepath", sources=["upload"])
52
+ audio_list = gr.Dropdown(
53
+ label="Choose an audio (optional)",
54
+ choices=[
55
+ "German1.wav", "German2.wav", "German3.wav", "German4.wav",
56
+ "acknowledgement_chinese.m4a", "acknowledgement_english.m4a",
57
+ "chinese1_haierlizhi.wav", "chinese2_guanyu.wav",
58
+ "french1.wav", "french2.wav", "french3.wav",
59
+ "italian1.wav", "italian2.wav", "italian3.wav",
60
+ "japan1.wav", "japan2.wav", "japan3.wav",
61
+ "korean1.wav", "korean2.wav", "korean3.wav",
62
+ "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",
63
+ "spanish1.wav", "spanish2.wav", "spanish3.wav"
64
+ ]
65
+ )
66
+ audio_list.change(
67
+ fn = load_audio,
68
+ inputs = [audio_list],
69
+ outputs = [audio_input]
70
+ )
71
  run_btn = gr.Button("Run")
72
  with gr.Column():
73
  output_video = gr.Video(format="mp4")