From 7d639abe78878a923d280b044d73f9c570b50b66 Mon Sep 17 00:00:00 2001 From: tomasbarak Date: Wed, 19 Apr 2023 01:37:16 -0300 Subject: [PATCH] Set return_complex param in stft function to false. It is needed to explicitly set this param to false, otherwise it wont work --- modules/nsf_hifigan/nvSTFT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nsf_hifigan/nvSTFT.py b/modules/nsf_hifigan/nvSTFT.py index 35635c8..80b9068 100644 --- a/modules/nsf_hifigan/nvSTFT.py +++ b/modules/nsf_hifigan/nvSTFT.py @@ -93,7 +93,7 @@ def get_mel(self, y, center=False): y = y.squeeze(1) spec = torch.stft(y, n_fft, hop_length=hop_length, win_length=win_size, window=self.hann_window[str(y.device)], - center=center, pad_mode='reflect', normalized=False, onesided=True) + center=center, pad_mode='reflect', normalized=False, onesided=True, return_complex=False) # print(111,spec) spec = torch.sqrt(spec.pow(2).sum(-1)+(1e-9)) # print(222,spec)