I have around 5000 audio samples and have make spectrogram of each and save as image. I already know how to make spectrogram with librosa, dispaly it and save in proper image. But every time before save image it despayes. Make this with all 5000 samples is not a good idea. Is it possible to save image without displaing it?
import numpy as np
import librosa
import librosa.display
import matplotlib.pyplot as plt
f_name = # path to current file
path = # path where to save result
X, s_rate = librosa.load(f_name, res_type='kaiser_fast', duration=4.0)
mfc = librosa.feature.melspectrogram(y=X, sr=s_rate)
ch = librosa.feature.chroma_stft(y=X, sr=s_rate)
sc = librosa.feature.spectral_contrast(y=X, sr=s_rate)
tz = librosa.feature.tonnetz(y=X, sr=s_rate)
small_MFCC = np.concatenate([mfc, ch, sc, tz], axis=0)
librosa.display.specshow(small_MFCC)
plt.savefig(path, bbox_inches="tight", pad_inches=0.0)