Spaces:
Sleeping
Sleeping
Update audioldm/audio/stft.py
Browse files- audioldm/audio/stft.py +6 -2
audioldm/audio/stft.py
CHANGED
@@ -148,8 +148,12 @@ class TacotronSTFT(torch.nn.Module):
|
|
148 |
self.n_mel_channels = n_mel_channels
|
149 |
self.sampling_rate = sampling_rate
|
150 |
self.stft_fn = STFT(filter_length, hop_length, win_length)
|
151 |
-
mel_basis =
|
152 |
-
sampling_rate,
|
|
|
|
|
|
|
|
|
153 |
)
|
154 |
mel_basis = torch.from_numpy(mel_basis).float()
|
155 |
self.register_buffer("mel_basis", mel_basis)
|
|
|
148 |
self.n_mel_channels = n_mel_channels
|
149 |
self.sampling_rate = sampling_rate
|
150 |
self.stft_fn = STFT(filter_length, hop_length, win_length)
|
151 |
+
mel_basis = librosa_filters.mel(
|
152 |
+
sr=sampling_rate,
|
153 |
+
n_fft=filter_length,
|
154 |
+
n_mels=n_mel_channels,
|
155 |
+
fmin=mel_fmin,
|
156 |
+
fmax=mel_fmax
|
157 |
)
|
158 |
mel_basis = torch.from_numpy(mel_basis).float()
|
159 |
self.register_buffer("mel_basis", mel_basis)
|