Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mddct committed Mar 2, 2024
1 parent f56726b commit 6af3a8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wenet/dataset/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ def compute_log_mel_spectrogram(sample,
waveform = F.pad(waveform, (0, padding))
if pad_or_trim:
length = max_duration * sample_rate
if waveform.size(1) >= length:
waveform = waveform[:, :length]
if waveform.size() >= length:
waveform = waveform[:length]
else:
waveform = F.pad(waveform, (0, length - waveform.size(1)))

Expand Down

0 comments on commit 6af3a8d

Please sign in to comment.