mirror of
https://github.com/wassname/TTS.git
synced 2026-10-28 12:41:20 +08:00
Warn user if nan in GL
This commit is contained in:
1 parent
ed4b1d8514
commit
742f9c54da
1 file changed
+3
@@ -608,6 +608,9 @@ class AudioProcessor(object):
|
||||
angles = np.exp(2j * np.pi * np.random.rand(*S.shape))
|
||||
S_complex = np.abs(S).astype(np.complex)
|
||||
y = self._istft(S_complex * angles)
|
||||
if not np.isfinite(y).all():
|
||||
print(" [!] Waveform is not finite everywhere. Skipping the GL.")
|
||||
return np.array([0])
|
||||
for _ in range(self.griffin_lim_iters):
|
||||
angles = np.exp(1j * np.angle(self._stft(y)))
|
||||
y = self._istft(S_complex * angles)
|
||||
|
||||
Reference in new issue
Block a user