-
Notifications
You must be signed in to change notification settings - Fork 844
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
62 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
--- | ||
default_iu3: | ||
train2: | ||
data_path: 'IU/*_split/*.wav' | ||
convert: | ||
data_path: 'korean/*.wav' | ||
one_full_wav: True | ||
batch_size: 10 | ||
one_full_wav: False | ||
batch_size: 4 | ||
--- | ||
iu: | ||
train2: | ||
data_path: 'IU/*_split/*.wav' | ||
batch_size: 64 | ||
convert: | ||
one_full_wav: False | ||
batch_size: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
#!/usr/bin/env python | ||
|
||
from pydub import AudioSegment | ||
import glob | ||
from audio_utils import split_path | ||
import os | ||
|
||
src_path = '/Users/avin/git/vc/datasets/IU/v_app_split' | ||
target_path = '{}_amp'.format(src_path) | ||
target_amp_in_db = -20 | ||
|
||
|
||
def match_target_amplitude(sound, target_dBFS): | ||
change_in_dBFS = target_dBFS - sound.dBFS | ||
return sound.apply_gain(change_in_dBFS) | ||
|
||
if not os.path.exists(target_path): | ||
os.mkdir(target_path) | ||
|
||
for filepath in glob.glob('{}/*.wav'.format(src_path)): | ||
basepath, filename, _ = split_path(filepath) | ||
sound = AudioSegment.from_wav(filepath) | ||
normalized_sound = match_target_amplitude(sound, target_amp_in_db) | ||
normalized_sound.export('{}/{}.wav'.format(target_path, filename), 'wav') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters