From 2dcdc14ea6cdd56e31c7aeb4ce24ae07ccb7161c Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Sat, 12 Oct 2019 18:34:28 +0200 Subject: [PATCH] UPDATE TRIM SILENCE --- utils/audio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/audio.py b/utils/audio.py index f6b8b5c3..4b8c427c 100644 --- a/utils/audio.py +++ b/utils/audio.py @@ -212,11 +212,11 @@ class AudioProcessor(object): return len(wav) def trim_silence(self, wav): - """ Trim silent parts with a threshold and 0.1 sec margin """ - margin = int(self.sample_rate * 0.1) + """ Trim silent parts with a threshold and 0.01 sec margin """ + margin = int(self.sample_rate * 0.01) wav = wav[margin:-margin] 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 def mulaw_encode(wav, qc):