TheStinger commited on
Commit
4299e80
β€’
1 Parent(s): e930f04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
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 [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
 
@@ -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()