readbeyond / aeneas

aeneas is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment)
http://www.readbeyond.it/aeneas/
GNU Affero General Public License v3.0
2.53k stars 233 forks source link

using plain text instead of file #262

Closed hypy13 closed 3 years ago

hypy13 commented 4 years ago

hi can i pass directly the text and audio without file path? and can i get the synced map json not in file just in python

i dont want to store the synced text in a file just want to get them and store them in database

tslater commented 4 years ago

I haven't figured out if there is a way to pass in a string instead of a file...but I have figured out how to get a string as output rather than a file:

    ...
    task = Task(config_string=config_string, rconf=rconf, logger=logger)
    task.audio_file_path_absolute = audio_file_path
    task.text_file_path_absolute = input_text_file
    ExecuteTask(task).execute()
    return task.sync_map.json_string

Hope this helps!