forked from jordai/NumberOfSpeakerEstimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_data.py
35 lines (27 loc) · 955 Bytes
/
create_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import sys
from src import util
import os
DATASETS=['mls_dutch', 'mls_german', 'mls_french']
BASE_DATA_DIR = '/vol/tensusers3/camghane/ASR/MLS'
for dataset in DATASETS:
data_dir = os.path.join(BASE_DATA_DIR,dataset)
#converting to wavs
print("converting to wavs")
in_dir = os.path.join(data_dir,'test','audio')
wav_data = os.path.join(data_dir, 'data','test','wav')
util.flacs_to_wavs(in_dir, wav_data+'/')
#splitting
print("splitting")
split_data = os.path.join(data_dir, 'data','test','split')
t=10
util.create_audio_splits(wav_data, split_data+'/', t)
#loudness
print("normalizing")
normalized_data = os.path.join(data_dir, 'data','test','normalized')
target = 70.
util.change_loudness(split_data, normalized_data +'/', target)
#merging
print("merging data")
merged_data = os.path.join(data_dir, 'data', 'test','merged')
max_nr_of_speakers = 10
util.merge_audiofiles(normalized_data, merged_data +'/', max_nr_of_speakers)