Skip to content

Commit

Permalink
Dataset preprocessing
Browse files Browse the repository at this point in the history
ㄴ debugging
  • Loading branch information
Yeongtae committed Nov 28, 2019
1 parent 9a8ad53 commit 6e9e789
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion preprocess_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand Down

0 comments on commit 6e9e789

Please sign in to comment.