From 8cd0d4aab71939e56539ff6c1027b37ad4324433 Mon Sep 17 00:00:00 2001
From: Steve Li <93230279+BitSteve@users.noreply.github.com>
Date: 星期五, 15 十一月 2024 11:03:31 +0800
Subject: [PATCH] Add bounds check for postprocess_utils.py abbr_dispose() (#2209)

---
 funasr/frontends/wav_frontend.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/funasr/frontends/wav_frontend.py b/funasr/frontends/wav_frontend.py
index a4002df..3324208 100644
--- a/funasr/frontends/wav_frontend.py
+++ b/funasr/frontends/wav_frontend.py
@@ -134,7 +134,7 @@
             mat = kaldi.fbank(
                 waveform,
                 num_mel_bins=self.n_mels,
-                frame_length=self.frame_length,
+                frame_length=min(self.frame_length,waveform_length/self.fs*1000),
                 frame_shift=self.frame_shift,
                 dither=self.dither,
                 energy_floor=0.0,

--
Gitblit v1.9.1