r4victor / syncabook

📖🎧 A tool for creating ebooks with synchronized text and audio (EPUB3 with Media Overlays)
MIT License
264 stars 27 forks source link

Help creating book from existing epub and m4b files #33

Open seannymurrs opened 3 weeks ago

seannymurrs commented 3 weeks ago

I'm trying to use syncabook to create a read aloud epub. I already have an epub copy of the book as well as an m4b copy of the audiobook. From looking at the direcctions, it seems like I need the ebook in xhtml format. I know I can get the xhtml files from the epub (by renaming the epub to a zip and extracting the xhtml files). Can I use those xhtml files to sync the book, or do I need to convert the epub to a txt file and then use syncabook to convert the txt to xhtml? If I can use the xhtml files from the epub, should I manually separate them into sync_text and no_sync_text folders?

r4victor commented 1 week ago

@seannymurrs

syncabook identifies text fragments in XHTML files by looking for tags with attributes of the form id="f[0-9]+" (see an example). If you use the to_xhtml command to produce XHTML files from plaintext, they will contain the proper tags automatically. If you use your own XHTML files, you'll need to modify them to contain the tags with id attributes.

So, theoretically, you could use XHTML files from an existing EPUB, but those XHTML files need to be modified to contain proper id tags.