Spaces:
Runtime error
Runtime error
TheStinger
commited on
Commit
•
501344c
1
Parent(s):
67c538c
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,7 @@ def create_spectrogram_and_get_info(audio_file):
|
|
65 |
if len(audio_data.shape) > 1:
|
66 |
audio_data = np.mean(audio_data, axis=1)
|
67 |
plt.specgram(audio_data, Fs=sample_rate / 1, NFFT=4096, sides='onesided',
|
68 |
-
cmap=
|
69 |
plt.savefig('spectrogram.png', dpi=300)
|
70 |
audio_info = sf.info(audio_file)
|
71 |
bit_depth = {'PCM_16': 16, 'FLOAT': 32}.get(audio_info.subtype, 0)
|
|
|
65 |
if len(audio_data.shape) > 1:
|
66 |
audio_data = np.mean(audio_data, axis=1)
|
67 |
plt.specgram(audio_data, Fs=sample_rate / 1, NFFT=4096, sides='onesided',
|
68 |
+
cmap=custom_cmap, scale_by_freq=True, scale='dB', mode='magnitude', window=np.hanning(4096)) # Usa la mappa di colori personalizzata
|
69 |
plt.savefig('spectrogram.png', dpi=300)
|
70 |
audio_info = sf.info(audio_file)
|
71 |
bit_depth = {'PCM_16': 16, 'FLOAT': 32}.get(audio_info.subtype, 0)
|