mirror of https://github.com/coqui-ai/TTS.git
Merge branch 'dev' of https://github.com/coqui-ai/TTS into dev
This commit is contained in:
commit
f38c5ee6c1
|
@ -674,7 +674,7 @@ class AudioProcessor(object):
|
|||
return f0
|
||||
|
||||
### Audio Processing ###
|
||||
def find_endpoint(self, wav: np.ndarray, threshold_db=-40, min_silence_sec=0.8) -> int:
|
||||
def find_endpoint(self, wav: np.ndarray, min_silence_sec=0.8) -> int:
|
||||
"""Find the last point without silence at the end of a audio signal.
|
||||
|
||||
Args:
|
||||
|
@ -687,7 +687,7 @@ class AudioProcessor(object):
|
|||
"""
|
||||
window_length = int(self.sample_rate * min_silence_sec)
|
||||
hop_length = int(window_length / 4)
|
||||
threshold = self._db_to_amp(threshold_db)
|
||||
threshold = self._db_to_amp(-self.trim_db)
|
||||
for x in range(hop_length, len(wav) - window_length, hop_length):
|
||||
if np.max(wav[x : x + window_length]) < threshold:
|
||||
return x + hop_length
|
||||
|
|
|
@ -265,6 +265,7 @@ class Synthesizer(object):
|
|||
waveform = waveform.squeeze()
|
||||
|
||||
# trim silence
|
||||
if self.tts_config.audio["do_trim_silence"] is True:
|
||||
waveform = trim_silence(waveform, self.ap)
|
||||
|
||||
wavs += list(waveform)
|
||||
|
|
Loading…
Reference in New Issue