Skip to content

Idea: offline ebook ↔ audiobook handoff using precomputed alignment (BookBridge?) #80

Description

@Kyomorie

Hi, thanks for all the work on this plugin.

I was thinking about a use case that seems closely related to the audiobook / Storyteller work already discussed in "#1", but slightly different.

The use case

A concrete example would be a flight:

Before boarding, both the EPUB and the matching audiobook are already downloaded to the e-reader. During the flight there is no network connection at all.

I might:

  1. read the EPUB for a while,
  2. switch to the audiobook at roughly the corresponding position,
  3. listen for some time,
  4. later switch back to the matching text position.

When connectivity returns after landing, ideally the normal KOReader and Audiobookshelf sync paths would resume from that latest position without losing or rewinding the progress made while offline.

So the main idea is not really to replace Audiobookshelf on a phone. It would make the e-reader self-contained during temporary periods without connectivity.

Maybe part of the difficult work already exists?

While looking into this I came across "BookBridge" (https://github.com/cporcellijr/bookbridge).

BookBridge already synchronizes reading/listening progress between Audiobookshelf and KOReader, and according to its documentation it can derive text ↔ audio alignment from Storyteller forced-alignment data, SMIL, or Whisper.

That made me wonder whether this plugin might not need to perform any alignment on the e-reader at all.

Conceptually:

BookBridge / another server-side tool
|
| precomputed alignment
v
ebook position <----> audiobook timestamp
|
v
audiobook.koplugin

The e-reader could just consume an optional precomputed mapping alongside the EPUB and audiobook.

For example, when I choose "continue listening from here", the plugin maps the current KOReader text position to an audiobook timestamp locally. When I stop listening and go back to reading, it maps the audio position back to the corresponding EPUB position.

All of that could work without network access.

Before trying to prototype anything, I'd be interested in your view on whether this fits the direction of the plugin:

  1. Would an optional external/precomputed alignment source make sense in the current architecture?

  2. If so, would you rather reuse the existing EPUB 3 / SMIL Media Overlay path, or could a small generic sidecar mapping be useful?

  3. What would be the minimum useful mapping for the plugin? For example:

    • audiobook timestamp
    • content document / href
    • xpointer / element path
    • some other KOReader-friendly locator
  4. For the offline use case, could the plugin keep the local reading and listening positions aligned when switching between them, so that once networking returns the normal Audiobookshelf and KOReader sync paths both represent the same logical progress?

  5. Or is there already a simpler mechanism in the plugin / KOReader that could achieve this without adding another alignment source?

I mainly wanted to point out BookBridge because it looks like it may already solve much of the expensive server-side alignment problem, rather than suggesting that another alignment implementation should be built from scratch.

Thanks!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions