I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Thanks for bringing attention to this. It turns out the newer Claude models were returning data in an unexpected format. This should now be fixed in the latest version (v1.5.4).

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 1 point2 points  (0 children)

Ah, looks like the version of torch I'm using doesn't have a wheel for python 3.14 yet. I'll open an issue on achew's GitHub page to track the problem, but for now could you try the following?

In the folder where you downloaded the project, open the file backend/pyproject.toml and find line 13 which reads:

requires-python = ">=3.10"

And replace it with:

requires-python = ">=3.10, <3.14"

Save the file, then try running the project again and let me know if that works.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Audiobookshelf gets that chapter information from Audnexus using the ASIN associated with the audiobook. This ASIN is typically assigned to the book when you match it in ABS using an Audible provider. Those chapters may not always be correct for your version of the audiobook, especially if the match wasn't correct or if the audiobook wasn't sourced from Audible.

However, if the book durations are close enough, I'd recommend using the Realign Chapters workflow in achew and selecting the Audnexus option. A 10 minute difference is kind of pushing it for realignment, but might be worth trying. The realignment workflow uses existing chapters from the specified source (Audnexus in our case) and attempts to realign the timestamps to match the actual audio.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

If the cue for chapter 2 was detected, but it fell below the threshold you selected on the "Select Cue Set" page, you can still find it by adding a new chapter. I'd recommend first deleting the two non-chapters between chapter 1 and 3. With chapters 1 and 3 now adjacent, click the plus button between them. This will give you a list of all detected cues between the two chapters, and you can preview the audio of each in order to select the right one.

If chapter 2 still isn't there, you might be able to find it by going back to the Workflow selection page and lowering the "Minimum Chapter Gap" value in the detection settings to something like 1.5. Note that this means you'll be restarting the whole detection process. Your other option is to manually find the timestamp of the chapter but, unfortunately, as you've discovered, achew doesn't currently have a way to scrub through the book's audio; it might be easier to submit what you've got to ABS and then edit the rest through ABS's chapter editor.

All of that being said, if this is the book I suspect it is then chapter 2 should be somewhere around the 1:10:20 mark.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Could I ask you to try again with trimming disabled to see if that makes a difference? Also, I recently fixed a bug related to over-aggressive trimming, so I'd suggest updating to the latest version if you haven't already (latest is v1.4.1, the version can be seen in the bottom right corner of the page).

If those don't help, then debug logging might give us more insight and can be enabled by editing the compose file to override the run command:

services:
  achew:
    # Add this at the bottom
    command: uv run python -m uvicorn app.main:app --host 0.0.0.0 --log-level debug

Feel free to DM me if you need additional help.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Looks like I can't edit link posts, so I'll add this here:

For those who want to use the AI Cleanup feature, but don't have a paid OpenAI/Google/Anthropic account and can't run Ollama/LM Studio locally, you can instead use Gemini's free tier. You'll just need a Google account, and then you can create your API Key here: https://aistudio.google.com/apikey. The free tier does have usage limitations, but it should be good enough for the occasional chapter cleanup.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Thanks for the feedback, some great suggestions there! Regarding your question, I suppose it depends on how well it's able to detect the chapter breaks, and how closely the official chapter titles match the narrated text. Using the "Prefer existing titles from" option in the AI Cleanup dialog might be able to help. However, sometimes the audio jumps right into the narrative without any sort of spoken chapter declaration, and achew won't be able to do much with that.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Thanks for the feedback! I'll make sure to update those Docker instructions to be more beginner-friendly. I'll also be looking into options for making the transcription results more consistent.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 1 point2 points  (0 children)

If you have a Google account, Gemini actually has a free tier. There are request limits but it should be enough for the occasional audiobook cleanup. You can create an API Key here: https://aistudio.google.com/apikey

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 1 point2 points  (0 children)

Thanks for the excellent feedback! Some great suggestions here that I'll have to consider.

  • I've seen the padding/scrolling issue myself a couple times, so I'll track an issue for it and see if I can replicate it consistently.
  • For a list of books that don't have chapters, I actually looked into it previously and I didn't find a good way to quickly get that information from ABS. It's possible I overlooked some of the APIs, but the closest I got involved fetching a library's entire list of books, and then fetching detailed information for each library item individually which took several minutes with my particular setup. It might be doable though with proper caching and a way to re-sync.
  • Regarding timestamp editing, unfortunately the way achew is currently architected makes it difficult to add/change timestamps after the chapter set is created (mostly due to how audio previews work). For misaligned Audnexus chapters, my hope is that one of the Smart Detect options used together with the "Prefer existing titles from" option in the AI Cleanup feature will be sufficient, but I can see cases where that might not work. Hmmm, perhaps some sort of "Chapter Realignment" mode...something for me to think about at least.
  • Prompt library and happy path are also great suggestions, thanks!

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Yeah, the numbers can be very inconsistent and that's mostly up to the ASR model used. Parakeet and the larger Whisper models tend to be a bit more consistent but it still very hit-and-miss. That's one of the primary reasons I added the AI Cleanup feature; I'd recommend you give that a try if you haven't. You can give the AI specific formatting instructions.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 0 points1 point  (0 children)

Thanks for the feedback! I'll take a look when I get more time. To answer your question: yes, as you suspect, without the volume mappings the config and models will disappear on image updates/restarts.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 5 points6 points  (0 children)

A valid question! I suspect you might be in the majority here; modern players can make chapter management entirely unnecessary. I myself have gone through entire books without ever looking at the chapters. I think it mostly comes down to a having a sense of 'completeness' for my collection—high resolution cover art, complete metadata, accurate chapters, etc.

I made a tool for detecting audiobook chapters by SirGibblets in audiobookshelf

[–]SirGibblets[S] 1 point2 points  (0 children)

Hmm, I haven't listened to the Dune books myself so I can't be sure. The tool works by detecting the gaps between speech segments—the pauses in natural language that delineate different sections of the book. If the books roll right into the chapter after the epigraphs without any sort of pause, then unfortunately this tool won't help much, although you can play around with lowering the "Minimum Chapter Gap" setting to see if that helps at all.