Skip to content

Commit

Permalink
correction
Browse files Browse the repository at this point in the history
  • Loading branch information
codename0og authored Dec 21, 2024
1 parent b88875d commit c52385a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rvc/train/mel_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ def mel_spectrogram(
mel_dtype_device = str(n_mels) + "_" + dtype_device
# caching hann window
if win_dtype_device not in self.hann_window:
self.hann_window[win_dtype_device] = torch.hann_window(window_length, device=wav.device, dtype=wav.dtype)

self.hann_window[win_dtype_device] = torch.hann_window(window_length, device=wav.device, dtype=torch.float32)
wav = wav.squeeze(1) # -> torch(B, T)

stft = torch.stft(
wav,
wav.float(),
n_fft=window_length,
hop_length=hop_length,
window=self.hann_window[win_dtype_device],
Expand All @@ -208,7 +208,7 @@ def mel_spectrogram(
fmin=0,
fmax=None,
)
).to(device=wav.device, dtype=wav.dtype)
).to(device=wav.device, dtype=torch.float32)

mel_spectrogram = torch.matmul(
self.mel_banks[mel_dtype_device], magnitude
Expand Down

0 comments on commit c52385a

Please sign in to comment.