From e870f6e633d84b47cd9ddcdcf23d5e4cabdffb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=81=A5?= Date: Fri, 11 Apr 2025 12:13:58 +0800 Subject: [PATCH] fix sample rate error in asr_feat.py --- fireredasr/data/asr_feat.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fireredasr/data/asr_feat.py b/fireredasr/data/asr_feat.py index 6666f39..342655b 100644 --- a/fireredasr/data/asr_feat.py +++ b/fireredasr/data/asr_feat.py @@ -82,6 +82,8 @@ def __init__(self, num_mel_bins=80, frame_length=25, frame_shift=10, opts.frame_opts.dither = dither opts.mel_opts.num_bins = num_mel_bins opts.frame_opts.snip_edges = True + opts.frame_opts.frame_length_ms = frame_length + opts.frame_opts.frame_shift_ms = frame_shift opts.mel_opts.debug_mel = False self.opts = opts @@ -94,6 +96,7 @@ def __call__(self, wav, is_train=False): dither = self.dither if is_train else 0.0 self.opts.frame_opts.dither = dither + self.opts.frame_opts.samp_freq = sample_rate fbank = knf.OnlineFbank(self.opts) fbank.accept_waveform(sample_rate, wav_np.tolist())