Spaces:
Runtime error
Runtime error
fix and warning remove
#3
by Eddycrack864 - opened
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(
|
| 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')
|