- config_string = "task_language=pol|is_text_type=unparsed|is_text_unparsed_id_regex=sec\d+$|is_text_unparsed_id_sort=numeric|os_task_file_format=tab"
- task = Task(config_string=config_string)
-
- # TODO: concatenate all the
- with tempfile.TemporaryDirectory() as temp:
- with open(temp + "/book.mp3", "wb") as m:
- for minput in mp3:
- with open(minput, "rb") as minputf:
- m.write(minputf.read())
-
-
- syncfile = temp + "/sync"
- task.audio_file_path_absolute = temp + "/book.mp3"
- task.text_file_path_absolute = html.get_filename()
- task.sync_map_file_path_absolute = syncfile
-
- ExecuteTask(task).execute()
- task.output_sync_map_file()
- sync = []
- with open(syncfile) as f:
- for line in f:
- start, end, sec = line.strip().split('\t')
- start = float(start)
- end = float(end)
- sync.append([start, end, sec])