new mozilla preprocessor

This commit is contained in:
Eren Golge 2019-05-20 18:20:48 +02:00
parent e62659da94
commit 1654a725a7
1 changed files with 15 additions and 1 deletions

View File

@ -29,7 +29,7 @@ def tweb(root_path, meta_file):
# return {'text': texts, 'wavs': wavs}
def mozilla(root_path, meta_file):
def mozilla_old(root_path, meta_file):
"""Normalizes Mozilla meta data files to TTS format"""
txt_file = os.path.join(root_path, meta_file)
items = []
@ -44,6 +44,20 @@ def mozilla(root_path, meta_file):
return items
def mozilla(root_path, meta_file):
"""Normalizes Mozilla meta data files to TTS format"""
txt_file = os.path.join(root_path, meta_file)
items = []
with open(txt_file, 'r') as ttf:
for line in ttf:
cols = line.split('|')
wav_file = cols[1].strip()
text = cols[0].strip()
wav_file = os.path.join(root_path, "wavs", wav_file)
items.append([text, wav_file])
return items
def mailabs(root_path, meta_files):
"""Normalizes M-AI-Labs meta data files to TTS format"""
folders = [os.path.dirname(f.strip()) for f in meta_files.split(",")]