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: