KinWaiCheuk / nnAudio

Audio processing by using pytorch 1D convolution network
MIT License
1.03k stars 89 forks source link

win_length option not working for MelSpectrogram #50

Closed jjhuang-ca closed 4 years ago

jjhuang-ca commented 4 years ago

I'm testing the win_length option using version 0.1.2.dev3 and 0.1.4a0. For both versions, I got an error when instantiating MelSpectrogram with this option.

mel = Spectrogram.MelSpectrogram(sr=16000, n_fft=512, device='cpu') STFT filter created, time used = 0.0072 seconds Mel filter created, time used = 0.0073 seconds mel = Spectrogram.MelSpectrogram(sr=16000, n_fft=512, win_length=400, device='cpu') Traceback (most recent call last): File "", line 1, in TypeError: init() got an unexpected keyword argument 'win_length'

$ pip list | grep nnAudio nnAudio 0.1.2.dev3

KinWaiCheuk commented 4 years ago

Hi huang, thanks for pointing out this bug. I forgot to include the win_length arg to MelSpectrogram in my previous release.

Please try the new version of nnAudio by pip install nnAudio==0.1.5a0. It should be working now.

Feel free to point out any bugs that you found.

jjhuang-ca commented 4 years ago

@KinWaiCheuk Thanks for the fix. I can confirm that it produces the same results as librosa using the same setting in win_length