- Speech-to-text. It has to be good, or the text you get back is unusable. Google's and Amazon's services for that will quickly become expensive for large volumes. And you need to mark text with time/position if you want ebook-to-audiobok sync.
- Diff algorithm between generated text and ebook text. Audiobooks are not produced from the same source material as ebooks, and they will have differences. On top of that you get errors and changes by narrators, and errors from speech-to-text. Not trivial if you want high fidelity.
- Figuring out the position in ebook from the diff. Relatively simple.
For ebook-to-audiobook you need to find the position in the speech-to-text conversion, and rewind to the time/position marking in that.
Storytel (disclaimer: I work at Storytel) has quite a few ebooks and audiobooks connected, but doesn't allow you to ingest your own ebooks and audiobooks.