firagne commited on
Commit
0fb5151
1 Parent(s): ff28df8
Files changed (1) hide show
  1. app.py +17 -14
app.py CHANGED
@@ -111,10 +111,6 @@ def process(file_name, embed_html_all):
111
  """
112
 
113
 
114
- def change_audio(value):
115
- return gr.Audio(value)
116
-
117
-
118
  with gr.Blocks() as demo:
119
  with gr.Row():
120
  with gr.Column():
@@ -136,24 +132,31 @@ with gr.Blocks() as demo:
136
 
137
  with gr.Row():
138
  with gr.Column():
139
- results = gr.File()
140
 
141
  with gr.Row():
142
  with gr.Column():
143
  select_results = gr.Dropdown()
144
  audio_player = gr.Audio()
145
 
146
- # for i in range(max_output):
 
 
147
 
148
- # tops.append(
149
- # gr.Textbox(label=f"top{i} track name", show_label=True)
150
- # )
151
- # tops.append(gr.Audio(label=f"top{i}", show_label=False))
152
 
153
- select_results.select(fn=change_audio, inputs=select_results, outputs=audio_player)
 
 
 
154
 
155
  analyze_url_btn.click(
156
- process_url, inputs=[audio_url_input], outputs=[html, results, select_results]
 
 
157
  )
158
  gr.Examples(
159
  examples=[
@@ -165,14 +168,14 @@ with gr.Blocks() as demo:
165
  "https://www.youtube.com/watch?v=Guzu9aAeDIc",
166
  ],
167
  inputs=[audio_url_input],
168
- outputs=[html, results, select_results],
169
  fn=process_url,
170
  cache_examples=False,
171
  )
172
  analyze_file_btn.click(
173
  process_file,
174
  inputs=[audio_input_file],
175
- outputs=[results, select_results],
176
  )
177
 
178
 
 
111
  """
112
 
113
 
 
 
 
 
114
  with gr.Blocks() as demo:
115
  with gr.Row():
116
  with gr.Column():
 
132
 
133
  with gr.Row():
134
  with gr.Column():
135
+ csv_results = gr.File()
136
 
137
  with gr.Row():
138
  with gr.Column():
139
  select_results = gr.Dropdown()
140
  audio_player = gr.Audio()
141
 
142
+ def change_audio(value):
143
+ audio_player = gr.Audio(value)
144
+ return audio_player
145
 
146
+ select_results.select(
147
+ fn=change_audio, inputs=select_results, outputs=audio_player
148
+ )
149
+ # for i in range(max_output):
150
 
151
+ # tops.append(
152
+ # gr.Textbox(label=f"top{i} track name", show_label=True)
153
+ # )
154
+ # tops.append(gr.Audio(label=f"top{i}", show_label=False))
155
 
156
  analyze_url_btn.click(
157
+ process_url,
158
+ inputs=[audio_url_input],
159
+ outputs=[html, csv_results, select_results.choices],
160
  )
161
  gr.Examples(
162
  examples=[
 
168
  "https://www.youtube.com/watch?v=Guzu9aAeDIc",
169
  ],
170
  inputs=[audio_url_input],
171
+ outputs=[html, csv_results, select_results.choices],
172
  fn=process_url,
173
  cache_examples=False,
174
  )
175
  analyze_file_btn.click(
176
  process_file,
177
  inputs=[audio_input_file],
178
+ outputs=[csv_results, select_results.choices],
179
  )
180
 
181