Skip to content

Conversation

jborza
Copy link
Contributor

@jborza jborza commented May 3, 2025

Related issue: #9

Added a new output format 'm4b', which will include chapters info.
To test it, I used an epub with chapters.

As libsndfile doesn't support m4a/m4b format, we first generate to a wav format, then
use ffmpeg to convert, including the chapters info.

ffmpeg gets installed on the first conversion, using static_ffmpeg package,
however, I'm not very happy with the way it works, as it installed another ffmpeg
binary into my system instead of finding that I already have ffmpeg on the path.

When the conversion completes, we delete the .wav file, chapters.txt and report
back success, with conversion to the m4b format.

Another thing - if ffmpeg conversion fails, maybe we could just jump to except Exception as e: statement in run(), and not catch the exception in except subprocess.CalledProcessError as e:, although we'd end up with two extra files - the .wav and chapters.txt.

Cheers

@denizsafak denizsafak changed the base branch from main to beta May 3, 2025 20:00
@denizsafak denizsafak merged commit 290d246 into denizsafak:beta May 3, 2025
3 checks passed
@denizsafak
Copy link
Owner

Thanks again! You've helped me a lot, and I really appreciate it. I'm merging this into beta and testing it now.

@denizsafak denizsafak mentioned this pull request May 4, 2025
denizsafak added a commit that referenced this pull request May 4, 2025
- Added new output format: `m4b`, enabling chapter metadata in audiobooks. Special thanks to @jborza for implementing this feature in PR #10.
- Better approach for determining the correct configuration folder for Linux and MacOS, using platformdirs. (Fixes Docker issue #12)
- Improvements in documentation and code.
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.

2 participants