def __update_speech_marks_file(tts_info, zip_file_name): if not tts_info['speechMarks']: return speech_marks_url = tts.get_speech_marks(tts_info, True) speech_marks_key = '{}-{}.txt'.format(tts.generate_key(tts_info), tts_info['speechMarks']) __add_to_zip(speech_marks_key, speech_marks_url, zip_file_name)
def __add_speech_line_definition(tts_info, speech_line_definitions, speech_lines_header): speech_line_definition = {} speech_line_definition[speech_lines_header[0]] = tts_info['character'] speech_line_definition[speech_lines_header[1]] = tts_info['line'] for tag in tts_info['tags']: key = 'Tags' value = tag if ':' in tag: key = tag.split(':')[0] value = tag.split(':')[1] if key not in speech_lines_header: speech_lines_header.append(key) if (key in speech_line_definition.keys()): speech_line_definition[key] = speech_line_definition[key] + ',' + value else: speech_line_definition[key] = value; speech_line_definition['MD5'] = tts.generate_key(tts_info) speech_line_definitions.append(speech_line_definition)
def __update_spoken_line_file(tts_info, zip_file_name): spoken_line_url = tts.get_voice(tts_info, True) spoken_line_key = '{}.pcm'.format(tts.generate_key(tts_info)) __add_to_zip(spoken_line_key, spoken_line_url, zip_file_name)