nakas commited on
Commit
b5f40c7
·
1 Parent(s): 0d79be9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -18,6 +18,7 @@ def greet(audio):
18
 
19
  mel = librosa.feature.melspectrogram(y=y, sr=sr)
20
  # #https://stackoverflow.com/questions/56719138/how-can-i-save-a-librosa-spectrogram-plot-as-a-specific-sized-image/57204349#57204349
 
21
  img = scale_minmax(mel, 0, 255).astype(np.uint8)
22
  img = 255-img
23
  return img
 
18
 
19
  mel = librosa.feature.melspectrogram(y=y, sr=sr)
20
  # #https://stackoverflow.com/questions/56719138/how-can-i-save-a-librosa-spectrogram-plot-as-a-specific-sized-image/57204349#57204349
21
+ mel = np.log(mel + 1e-9)
22
  img = scale_minmax(mel, 0, 255).astype(np.uint8)
23
  img = 255-img
24
  return img