|
|
@ -50,7 +50,7 @@ def create_manifest(data_dir, manifest_path_prefix):
|
|
|
|
total_text = 0.0
|
|
|
|
total_text = 0.0
|
|
|
|
total_num = 0
|
|
|
|
total_num = 0
|
|
|
|
|
|
|
|
|
|
|
|
phn_path = os.path.join(data_dir, dtype+'.text')
|
|
|
|
phn_path = os.path.join(data_dir, dtype + '.text')
|
|
|
|
phn_dict = {}
|
|
|
|
phn_dict = {}
|
|
|
|
for line in codecs.open(phn_path, 'r', 'utf-8'):
|
|
|
|
for line in codecs.open(phn_path, 'r', 'utf-8'):
|
|
|
|
line = line.strip()
|
|
|
|
line = line.strip()
|
|
|
@ -59,7 +59,7 @@ def create_manifest(data_dir, manifest_path_prefix):
|
|
|
|
audio_id, text = line.split(' ', 1)
|
|
|
|
audio_id, text = line.split(' ', 1)
|
|
|
|
phn_dict[audio_id] = text
|
|
|
|
phn_dict[audio_id] = text
|
|
|
|
|
|
|
|
|
|
|
|
audio_dir = os.path.join(data_dir, dtype+'_sph.scp')
|
|
|
|
audio_dir = os.path.join(data_dir, dtype + '_sph.scp')
|
|
|
|
for line in codecs.open(audio_dir, 'r', 'utf-8'):
|
|
|
|
for line in codecs.open(audio_dir, 'r', 'utf-8'):
|
|
|
|
audio_id, audio_path = line.strip().split()
|
|
|
|
audio_id, audio_path = line.strip().split()
|
|
|
|
# if no transcription for audio then raise error
|
|
|
|
# if no transcription for audio then raise error
|
|
|
@ -99,9 +99,7 @@ def main():
|
|
|
|
if args.src_dir.startswith('~'):
|
|
|
|
if args.src_dir.startswith('~'):
|
|
|
|
args.src_dir = os.path.expanduser(args.src_dir)
|
|
|
|
args.src_dir = os.path.expanduser(args.src_dir)
|
|
|
|
|
|
|
|
|
|
|
|
prepare_dataset(
|
|
|
|
prepare_dataset(src_dir=args.src_dir, manifest_path=args.manifest_prefix)
|
|
|
|
src_dir=args.src_dir,
|
|
|
|
|
|
|
|
manifest_path=args.manifest_prefix)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("manifest prepare done!")
|
|
|
|
print("manifest prepare done!")
|
|
|
|
|
|
|
|
|
|
|
|