I did toy with this idea for a couple evenings and I found a way to solve some cases. I will copy some of the docstring here so you can decide if this fits your particular case.
You may find yourself in one of this cases:
(1) Your texts and audios are chapter-structured.
Then you don't need any of this and you can just post your pairing to LingQ.
(2) Your texts are chapter-structured but your audios are NOT.
In this case you would want to split with "Preserving chapters" with simply:
process_files(
language="ell",
files_dir="my_input_files",
)
This only modifies audios.
(3) Your texts and audios are NOT chapter-structured.
If you want them to be chapter-structured, this (and most likely no tool out there) does
not support it. You will have to manually tailor your particular case.
If instead you want to split it in a number of sections to adapt the length to your needs
you can by either:
process_files(
language="ell",
files_dir="my_input_files",
n_sections=10, # At most 10 sections
)
Or if you have a number of seconds per section in mind:
process_files(
language="ell",
files_dir="my_input_files",
cut_at_seconds=30, # At least 30 seconds
)
This modifies texts and audios.
My chapter-structured I mean
example
├── texts
│ ├── chapter1.txt
│ └── chapter2.txt
└── audios
├── audio1.mp3
├── audio2.mp3
└── audio3.mp3
Caveats:
- I was only able to test it briefly. Worked very well except for one cut of a 1h20~ audio where it was 10~seconds off (and then it fixed itself later on). Maybe precision issues.
aeneas
is (sort of) hard to install.- No guarantees on
aeneas
supporting your language. - Some parts are still WIP
The code is in the already linked repo.