From b0f22d0433704727890978a7bd26d939f865ac11 Mon Sep 17 00:00:00 2001 From: Jem Date: Mon, 12 Aug 2019 11:05:09 +0800 Subject: [PATCH] fix(audio preprocessor): filter audio with zero length --- gnes/preprocessor/helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnes/preprocessor/helper.py b/gnes/preprocessor/helper.py index e08b81ab..018bc549 100644 --- a/gnes/preprocessor/helper.py +++ b/gnes/preprocessor/helper.py @@ -95,7 +95,8 @@ def get_audio(buffer_data, sample_rate, interval, # has multiple channels, do average if len(data.shape) == 2: data = np.mean(data, axis=1) - audio_list.append(data) + if data.shape[0] != 0: + audio_list.append(data) start_time = end_time