TheStinger commited on
Commit
2b4b5d9
β€’
1 Parent(s): bbc007c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -16
app.py CHANGED
@@ -7,27 +7,30 @@ import soundfile as sf
7
  def main():
8
  # Gradio Interface
9
  with gr.Blocks() as app:
10
- with gr.Group():
11
- gr.Markdown(
12
- """
13
- # <div align="center"> Ilaria Audio Analyzer πŸ’– </div>
14
- Audio Analyzer Software by Ilaria, Help me on [Ko-Fi](https://ko-fi.com/ilariaowo)\n
15
- Special thanks to [Alex Murkoff](https://github.com/alexlnkp) for helping me coding it!
16
 
17
- Need help with AI? [Join AI Hub!](https://discord.gg/aihub)
18
- """
19
- )
20
-
21
- output_markdown = gr.Markdown()
22
 
 
23
  audio_input = gr.Audio(type='filepath')
24
- image_output = gr.Image(type='filepath', interactive=False)
 
 
25
 
26
- create_spec_butt = gr.Button(value='Create Spectrogram And Get Info')
27
-
28
- create_spec_butt.click(fn=create_spectrogram_and_get_info, inputs=[audio_input], outputs=[output_markdown, image_output])
29
 
30
- app.queue(max_size=1022).launch(share=True)
 
 
 
31
 
32
  def create_spectrogram_and_get_info(audio_file):
33
  # Clear figure in case it has data in it
 
7
  def main():
8
  # Gradio Interface
9
  with gr.Blocks() as app:
10
+ gr.Markdown(
11
+ """
12
+ # <div align="center"> Ilaria Audio Analyzer πŸ’– </div>
13
+ Audio Analyzer Software by Ilaria, Help me on [Ko-Fi](https://ko-fi.com/ilariaowo)\n
14
+ Special thanks to [Alex Murkoff](https://github.com/alexlnkp) for helping me coding it!
 
15
 
16
+ Need help with AI? [Join AI Hub!](https://discord.gg/aihub)
17
+ """
18
+ )
 
 
19
 
20
+ with gr.Column():
21
  audio_input = gr.Audio(type='filepath')
22
+ with gr.Row():
23
+ create_spec_butt = gr.Button(value='Create Spectrogram And Get Info')
24
+ clear_audio_butt = gr.Button(value='Clear', variant='primary')
25
 
26
+ with gr.Column():
27
+ output_markdown = gr.Markdown()
28
+ image_output = gr.Image(type='filepath', interactive=False)
29
 
30
+ clear_audio_butt.click(fn=lambda: {"value": "", "__type__": "update"}, inputs=[], outputs=[audio_input])
31
+ create_spec_butt.click(fn=create_spectrogram_and_get_info, inputs=[audio_input], outputs=[output_markdown, image_output])
32
+
33
+ app.queue(max_size=1022).launch(share=True)
34
 
35
  def create_spectrogram_and_get_info(audio_file):
36
  # Clear figure in case it has data in it