Eddycrack864 commited on
Commit
71b7d92
1 Parent(s): 49e050b

fix and warning remove

Browse files

Currently Ilaria Audio Analyzer is not working correctly due to the error "melspectrogram() takes 0 positional arguments but 1 positional argument (and 1 keyword-only argument) were given" which was fixed on line 61.

Also removed the "share=True" on line 55, to avoid the warning

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -52,13 +52,13 @@ def main():
52
  create_spec_butt.click(fn=create_spectrogram_and_get_info, inputs=[audio_input],
53
  outputs=[output_markdown, image_output])
54
 
55
- app.queue(max_size=1022).launch(share=True)
56
 
57
  def create_spectrogram_and_get_info(audio_file):
58
  plt.clf()
59
 
60
  y, sr = librosa.load(audio_file, sr=None)
61
- S = librosa.feature.melspectrogram(y, sr=sr, n_mels=256)
62
  log_S = librosa.amplitude_to_db(S, ref=np.max, top_db=256)
63
  plt.figure(figsize=(12, 5.5))
64
  librosa.display.specshow(log_S, sr=sr, x_axis='time')
 
52
  create_spec_butt.click(fn=create_spectrogram_and_get_info, inputs=[audio_input],
53
  outputs=[output_markdown, image_output])
54
 
55
+ app.queue(max_size=1022).launch()
56
 
57
  def create_spectrogram_and_get_info(audio_file):
58
  plt.clf()
59
 
60
  y, sr = librosa.load(audio_file, sr=None)
61
+ S = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=256)
62
  log_S = librosa.amplitude_to_db(S, ref=np.max, top_db=256)
63
  plt.figure(figsize=(12, 5.5))
64
  librosa.display.specshow(log_S, sr=sr, x_axis='time')