From 7d56a55b69244c628720dc49e0ad88f37279ac67 Mon Sep 17 00:00:00 2001 From: mjmorl Date: Sun, 16 Feb 2020 23:42:51 +0000 Subject: [PATCH] print shapes of mfccs --- src/audio/ingest.py | 1 + src/audio/processing/feature_extraction.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/audio/ingest.py b/src/audio/ingest.py index e99f126..76fd6bf 100644 --- a/src/audio/ingest.py +++ b/src/audio/ingest.py @@ -42,6 +42,7 @@ def __read_audio_to_dict(path, file_format): genres = __get_genres_from_path(p, path) d = tracks_dict ts, sr = get_time_series_and_sample_rate_of_audio(p) + featx.get_mfccs(ts, sr, name=p.name) for g in genres: if not d[g]: d[g] = [ts] diff --git a/src/audio/processing/feature_extraction.py b/src/audio/processing/feature_extraction.py index b6d7507..8d54071 100644 --- a/src/audio/processing/feature_extraction.py +++ b/src/audio/processing/feature_extraction.py @@ -6,6 +6,9 @@ def get_spectral_centroids(ts, sr): return spectral_centroids[0] -def get_mfccs(ts, sr): +def get_mfccs(ts, sr, name=None): mfccs = librosa.feature.mfcc(ts, sr=sr) - print(mfccs.shape) + if name is not None: + print(name + str(mfccs.shape)) + else: + print(mfccs.shape)