From edf065541e5f727319a669167ef029ee701307ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E9=9C=87=E4=B8=9C?= <275331498@qq.com> Date: Wed, 24 Jul 2024 13:03:03 +0800 Subject: [PATCH] [Fix] Fix torchaudio load params (#2582) filepath => uri --- wenet/dataset/processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wenet/dataset/processor.py b/wenet/dataset/processor.py index 4de0a29cf..8f0b05637 100644 --- a/wenet/dataset/processor.py +++ b/wenet/dataset/processor.py @@ -144,7 +144,7 @@ def decode_wav(sample): start_frame = int(sample['start'] * sample_rate) end_frame = int(sample['end'] * sample_rate) with io.BytesIO(wav_file) as file_obj: - waveform, _ = torchaudio.load(filepath=file_obj, + waveform, _ = torchaudio.load(file_obj, num_frames=end_frame - start_frame, frame_offset=start_frame) else: