10.3 Audio Combine Audiobook

20241029

Use case is that you have purchased the audio book of Thomas Wenn’s Victerra Trilogy of three books. Book 1 is Stars of the Mind. The chapters came as separate mp3 files, 01_chapter_1.mp3 etc., and the folder includes the book cover as folder.jpg. To upload this to your Android app for managing podcasts, AntennaPod, you want it as a single mp3 file in your devices internal shared storage/AudioBooks folder. You have added this folder to AntennaPod’s folders to monitor.

We will use sox which re-processes the mp3 audio into a single stream. We could have used mp3wrap or ffmpeg to combine the audio, as in Section @ref(audio_combine).

sox *.mp3 combined.mp3

Next we add the book cover using ffmpeg.

ffmpeg -i combined.mp3 -i folder.jpg -map 0 -map 1 -c copy -id3v2_version 3 combined_cover.mp3

We might have the book blurb available in comment.txt, each paragraph on a single line, and that can be added to the comment tag of the mp3 file.

eyeD3 --add-comment "$(cat comment.txt)" combined_cover.mp3 

Finally, rename it as you like:

mv combined_cover.mp3 thomas_wenn_2028_victerra_trilogy_book_1_stars_of_the_mind.mp3

Of course, the audio files could be your music collection or a playlist you want to combine into a single file.



Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0