TorchAudio : __init__() got an unexpected keyword argument 'center'


I was passing some mel arguments into the torchaudio.transforms.MFCC function but it doesn’t seem to recognize the argument “center”. Center is a parameter to the Mel Spectorgram so I don’t understand why it’s not working.


melkwargs = {
    "center": False,
    "n_fft": n_fft,
    "hop_length": hop_length,
    "power": 2,
    "f_min": f_min,
    "f_max": f_max

mfcc_module = torchaudio.transforms.MFCC(sample_rate=sample_rate, n_mfcc=20, melkwargs=melkwargs)
torch_mfcc = mfcc_module(torch.tensor(waveform))


TypeError: init() got an unexpected keyword argument ‘center’

Any help would be appreciated.

You might need to update torchaudio to 0.8.0, as the center argument doesn’t seem to be available in previous versions.