Commit
·
9fe4a42
1
Parent(s):
8a244f3
Update app.py
Browse files
app.py
CHANGED
@@ -4,21 +4,28 @@ import numpy as np
|
|
4 |
import os
|
5 |
import soundfile as sf
|
6 |
|
7 |
-
|
8 |
-
|
9 |
def main():
|
10 |
# Gradio Interface
|
11 |
-
with gr.Blocks(
|
12 |
-
|
13 |
gr.Markdown(
|
14 |
-
"""# <div align="center"> Ilaria Audio Analyzer
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
)
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
def create_spectrogram_and_get_info(audio_file):
|
24 |
# Clear figure in case it has data in it
|
@@ -67,5 +74,3 @@ def create_spectrogram_and_get_info(audio_file):
|
|
67 |
|
68 |
# Create the Gradio interface
|
69 |
main()
|
70 |
-
iface = gr.Interface(fn=create_spectrogram_and_get_info, inputs=gr.Audio(type="filepath"), outputs=["markdown", "image"])
|
71 |
-
iface.launch()
|
|
|
4 |
import os
|
5 |
import soundfile as sf
|
6 |
|
|
|
|
|
7 |
def main():
|
8 |
# Gradio Interface
|
9 |
+
with gr.Blocks() as app:
|
|
|
10 |
gr.Markdown(
|
11 |
+
"""# <div align="center"> Ilaria Audio Analyzer :sparkling_heart: </div>
|
12 |
+
Audio Analyzer Software by Ilaria, Help me on [Ko-Fi](https://ko-fi.com/ilariaowo)
|
13 |
+
Special thanks to [Alex Murkoff](https://github.com/alexlnkp) for helping me coding it!
|
14 |
+
|
15 |
+
Need help with AI? [Join AI Hub!](https://discord.gg/aihub)
|
16 |
+
"""
|
17 |
)
|
18 |
+
|
19 |
+
output_markdown = gr.Markdown()
|
20 |
+
|
21 |
+
audio_input = gr.Audio(type='filepath')
|
22 |
+
image_output = gr.Image(type='filepath', interactive=False)
|
23 |
+
|
24 |
+
create_spec_butt = gr.Button(value='Create Spectrogram And Get Info')
|
25 |
+
|
26 |
+
create_spec_butt.click(fn=create_spectrogram_and_get_info, inputs=[audio_input], outputs=[output_markdown, image_output])
|
27 |
+
|
28 |
+
app.queue(max_size=1022).launch(share=True)
|
29 |
|
30 |
def create_spectrogram_and_get_info(audio_file):
|
31 |
# Clear figure in case it has data in it
|
|
|
74 |
|
75 |
# Create the Gradio interface
|
76 |
main()
|
|
|
|