Spaces:
Runtime error
Runtime error
TheStinger
commited on
Commit
β’
4299e80
1
Parent(s):
e930f04
Update app.py
Browse files
app.py
CHANGED
@@ -9,11 +9,11 @@ def main():
|
|
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
|
14 |
-
Special thanks to
|
15 |
|
16 |
-
Need help with AI?
|
17 |
"""
|
18 |
)
|
19 |
|
@@ -70,9 +70,21 @@ def create_spectrogram_and_get_info(audio_file):
|
|
70 |
| Audio Channels | {audio_info.channels} |
|
71 |
| Bitrate | {bitrate:.2f} Mb/s |
|
72 |
"""
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
# Return the PNG file of the spectrogram and the info table
|
75 |
-
return info_table, 'spectrogram.png'
|
76 |
|
77 |
# Create the Gradio interface
|
78 |
main()
|
|
|
9 |
with gr.Blocks() as app:
|
10 |
gr.Markdown(
|
11 |
"""
|
12 |
+
# <div align="center"> Ilaria Audio Analyzer π (BETA) </div>
|
13 |
+
Audio Analyzer Software by Ilaria, Help me on Ko-Fi\n
|
14 |
+
Special thanks to Alex Murkoff for helping me coding it!
|
15 |
|
16 |
+
Need help with AI? Join AI Hub!
|
17 |
"""
|
18 |
)
|
19 |
|
|
|
70 |
| Audio Channels | {audio_info.channels} |
|
71 |
| Bitrate | {bitrate:.2f} Mb/s |
|
72 |
"""
|
73 |
+
|
74 |
+
# Create a new figure for the info table
|
75 |
+
fig, ax = plt.subplots()
|
76 |
+
|
77 |
+
# Hide axes
|
78 |
+
ax.axis('tight')
|
79 |
+
ax.axis('off')
|
80 |
+
|
81 |
+
# Create table and save as image
|
82 |
+
ax.table(cellText=[info_table.split("\n")], cellLoc = 'center', loc='center')
|
83 |
+
|
84 |
+
plt.savefig('info_table.png')
|
85 |
+
|
86 |
# Return the PNG file of the spectrogram and the info table
|
87 |
+
return 'info_table.png', 'spectrogram.png'
|
88 |
|
89 |
# Create the Gradio interface
|
90 |
main()
|