mirror of https://github.com/coqui-ai/TTS.git
UPDATE TRIM SILENCE
This commit is contained in:
parent
53ec066733
commit
2dcdc14ea6
utils
|
@ -212,11 +212,11 @@ class AudioProcessor(object):
|
||||||
return len(wav)
|
return len(wav)
|
||||||
|
|
||||||
def trim_silence(self, wav):
|
def trim_silence(self, wav):
|
||||||
""" Trim silent parts with a threshold and 0.1 sec margin """
|
""" Trim silent parts with a threshold and 0.01 sec margin """
|
||||||
margin = int(self.sample_rate * 0.1)
|
margin = int(self.sample_rate * 0.01)
|
||||||
wav = wav[margin:-margin]
|
wav = wav[margin:-margin]
|
||||||
return librosa.effects.trim(
|
return librosa.effects.trim(
|
||||||
wav, top_db=40, frame_length=1024, hop_length=256)[0]
|
wav, top_db=60, frame_length=self.win_length, hop_length=self.hop_length)[0]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def mulaw_encode(wav, qc):
|
def mulaw_encode(wav, qc):
|
||||||
|
|
Loading…
Reference in New Issue