From 4159c674979b95ad5e3b5433194ee53ec59cf617 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Tue, 16 Aug 2022 17:18:17 +0800 Subject: [PATCH] Fix for mono input Signed-off-by: Jael Gu --- nn_fingerprint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nn_fingerprint.py b/nn_fingerprint.py index 680fc23..709020a 100644 --- a/nn_fingerprint.py +++ b/nn_fingerprint.py @@ -115,7 +115,9 @@ class NNFingerprint(NNOperator): audio = numpy.vstack(frames).transpose() else: audio = numpy.hstack(frames) - audio = audio[None, :] + if len(audio.shape) == 1: + audio = audio[None, :] + assert len(audio.shape) == 2 audio = self.int2float(audio) if sr != self.params['sample_rate']: