Skip to content

Commit 184466a

Browse files
authored
Add melkwargs setting for MFCC in HuBERT pipeline (#1949)
1 parent 0c48edd commit 184466a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/hubert/utils/feature_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ def extract_feature(
6868
waveform = waveform[0].to(device)
6969
if feature_type == "mfcc":
7070
feature_extractor = torchaudio.transforms.MFCC(
71-
sample_rate=sample_rate
71+
sample_rate=sample_rate,
72+
n_mfcc=13,
73+
melkwargs={'n_fft': 400, 'hop_length': 160, 'center': False}
7274
).to(device)
7375
mfccs = feature_extractor(waveform) # (freq, time)
7476
# mfccs = torchaudio.compliance.kaldi.mfcc(

0 commit comments

Comments
 (0)