I am doing my final year project of genre classification. For that I need to extract spectogram of multiple files. I know how to extract the spectogram of single audio, but i need spectogram for every audio file.
My for loop code is:
#display Spectrogram
for file in range(0,len(audio_path),1):
X = librosa.stft(x)
Xdb = librosa.amplitude_to_db(abs(X))
plt.figure(figsize=(14, 5))
librosa.display.specshow(Xdb, sr=sr, x_axis='time', y_axis='hz')
#If to pring log of frequencies
#librosa.display.specshow(Xdb, sr=sr, x_axis='time', y_axis='log')
plt.colorbar()
Any help would be appreciated! Thanks.