From ac27ff926fe31bd90f686b5f82e2e7665f3e2407 Mon Sep 17 00:00:00 2001 From: Jordan E <54383663+jordanehli@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:25:03 -0500 Subject: [PATCH] Update utils.py The function librosa.feature.melspectrogram was updated and you need to specify y= for the audio time series argument or else you will get a positional error. When I added this edit on my own machine it fixed the error. --- utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index 85fd3e2b..9a3f63fd 100644 --- a/utils.py +++ b/utils.py @@ -90,7 +90,7 @@ def extract_feature(file_name, **kwargs): chroma = np.mean(librosa.feature.chroma_stft(S=stft, sr=sample_rate).T,axis=0) result = np.hstack((result, chroma)) if mel: - mel = np.mean(librosa.feature.melspectrogram(X, sr=sample_rate).T,axis=0) + mel = np.mean(librosa.feature.melspectrogram(y=X, sr=sample_rate).T,axis=0) result = np.hstack((result, mel)) if contrast: contrast = np.mean(librosa.feature.spectral_contrast(S=stft, sr=sample_rate).T,axis=0) @@ -125,4 +125,4 @@ def get_audio_config(features_list): raise TypeError(f"Feature passed: {feature} is not recognized.") audio_config[feature] = True return audio_config - \ No newline at end of file +