From 0735473596296cf9871dd01b2f98f332a9fcad0a Mon Sep 17 00:00:00 2001 From: Lengyue Date: Tue, 14 Feb 2023 02:58:58 -0500 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=9C=AB=E5=B0=BE=E7=A9=BA?= =?UTF-8?q?=E5=88=87=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fish_audio_preprocess/utils/slice_audio.py | 5 +++-- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fish_audio_preprocess/utils/slice_audio.py b/fish_audio_preprocess/utils/slice_audio.py index 3e106ae..dfa695e 100644 --- a/fish_audio_preprocess/utils/slice_audio.py +++ b/fish_audio_preprocess/utils/slice_audio.py @@ -87,8 +87,9 @@ def slice_audio( arr.append(np.zeros(silent_shape, dtype=audio.dtype)) - _gen = np.concatenate(arr) - yield from slice_by_max_duration(_gen, max_duration, rate) + if duration > 0: + _gen = np.concatenate(arr) + yield from slice_by_max_duration(_gen, max_duration, rate) def slice_audio_file( diff --git a/pyproject.toml b/pyproject.toml index 4bb437f..2bbcfaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fish-audio-preprocess" -version = "0.1.8" +version = "0.1.9" description = "Preprocess audio data" authors = ["Lengyue "] license = "Apache"