From 6e9e78935aa2bbbdfda78ca78ecf21071e279d2d Mon Sep 17 00:00:00 2001 From: YeongTae Date: Thu, 28 Nov 2019 14:55:22 +0900 Subject: [PATCH] =?UTF-8?q?Dataset=20preprocessing=20=E3=84=B4=20debugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- preprocess_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preprocess_dataset.py b/preprocess_dataset.py index 5a4a0db6f..46e5406dc 100644 --- a/preprocess_dataset.py +++ b/preprocess_dataset.py @@ -27,10 +27,10 @@ def preprocess_audio(file_list, silence_audio_size, pre_emphasis=True): data, sampling_rate = librosa.core.load(wav_file, sr) data = data / np.abs(data).max() *0.999 data_= librosa.effects.trim(data, top_db= trim_top_db, frame_length=trim_fft_size, hop_length=trim_hop_size)[0] - data_ = data_*max_wav_value if (pre_emphasis): data_ = np.append(data_[0], data_[1:] - 0.97 * data_[:-1]) data_ = data_ / np.abs(data_).max() * 0.999 + data_ = data_ * max_wav_value data_ = np.append(data_, [0.]*silence_audio_size) data_ = data_.astype(dtype=np.int16) write(wav_file, sr, data_)