Skip to content

Prepare for Audiobook Support - #627

Open
emassey0135 wants to merge 1 commit into
trypsynth:masterfrom
emassey0135:audio-timeline
Open

Prepare for Audiobook Support#627
emassey0135 wants to merge 1 commit into
trypsynth:masterfrom
emassey0135:audio-timeline

Conversation

@emassey0135

Copy link
Copy Markdown
Contributor

This adds the foundation of audiobook support, both full audiobooks with no text, and books with full-text full-audio, and anything in between. The AudioTimeline struct stores audio sources (individual files), and clips, which have a source, a start and end time, and a start and end position within the text. There are also helper functions for getting the clip at a text position, getting a position from a clip, getting the percentage played in the audio (in pure audiobooks this will be vastly better than using text for progress), etc. There is also a new parser flag indicating if audio is present. To add audio to a parser, it just needs to create an audio timeline and include it in the Document. For audio-only books, I imagine the only text the parser would return is the chapter titles as headings, but this should be fine if the elapsed time is stored in bookmarks and playback position, in addition to the text position.

@trypsynth

Copy link
Copy Markdown
Owner

Thanks for this! I just pushed a branch I had been working on that caused some conflicts around how we handle flags though, sorry about that! Can you please fix, then I'll review?

@rkingett

rkingett commented Aug 6, 2026

Copy link
Copy Markdown

Exciting! For M4B Books with many chapters, will it pull from the metadata or fallback to generic track 1, if that data isn't for some reason within the audio file?

@trypsynth

Copy link
Copy Markdown
Owner

yeah, I'll make it try multiple approaches before giving up and going with the generic name.

@emassey0135

Copy link
Copy Markdown
Contributor Author

Exciting! For M4B Books with many chapters, will it pull from the metadata or fallback to generic track 1, if that data isn't for some reason within the audio file?

When an M4B parser is written later, yes it should support chapters. This PR just adds the ability for parsers to include audio inside documents and for the future playback logic in the front-ends to reference it. The Paperback document model is all still there, so chapters will become headings if the parser extracts them from the file.

…undation of audiobook and text-and-audio support
@emassey0135

Copy link
Copy Markdown
Contributor Author

It should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants