Also do dynamic range compression across mel

This commit is contained in:
James Betker 2021-12-10 20:06:24 -07:00
parent faf55684b8
commit 306274245b

View File

@ -617,6 +617,8 @@ class TorchMelSpectrogramInjector(Injector):
assert len(inp.shape) == 2
self.mel_stft = self.mel_stft.to(inp.device)
mel = self.mel_stft(inp)
# Perform dynamic range compression
mel = torch.log(torch.clamp(mel, min=1e-5))
return {self.output: mel}