Spaces:
Runtime error
Runtime error
TheStinger
commited on
Commit
β’
2b4b5d9
1
Parent(s):
bbc007c
Update app.py
Browse files
app.py
CHANGED
@@ -7,27 +7,30 @@ import soundfile as sf
|
|
7 |
def main():
|
8 |
# Gradio Interface
|
9 |
with gr.Blocks() as app:
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
Special thanks to [Alex Murkoff](https://github.com/alexlnkp) for helping me coding it!
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
output_markdown = gr.Markdown()
|
22 |
|
|
|
23 |
audio_input = gr.Audio(type='filepath')
|
24 |
-
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
|
30 |
-
|
|
|
|
|
|
|
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
|