This is just something I hacked together to create an audiobook file out of CD audio files (complete with chapter marking metadata!)
Works great when used in combination with https://github.com/kentcdodds/podcastify-dir
npx https://gist.github.com/kentcdodds/e07f9106c63cc13a75adb0157700eb5b ./path-to-sorted-mp3s
path-to-sorted-mp3s
├── 01.mp3
├── 02.mp3
├── 03.mp3
├── 04.mp3
├── art.jpg
└── metadata.json
The art.jpg will be used for the album cover. The metadata.json
will be used for ID3 tags. Should be something like this:
{
"title": "Book Title",
"artist": "Author name",
"subtitle": "Some description",
"albumArtist": "Author name",
"copyright": "copyright info",
"date": "1988",
"year": "1988-01-01",
"userDefinedText": [
{
"description": "book_genre",
"value": "Children's Audiobooks:Literature & Fiction:Dramatized"
},
{
"description": "narrated_by",
"value": "BBC"
},
{
"description": "comment",
"value": "Some description"
},
{
"description": "author",
"value": "Author Name"
},
{
"description": "asin",
"value": "49201153"
}
]
}
It seems to require a path without spaces in it (even with quote marks) - otherwise, it throws an FFmpeg error.
However, while it concatenated the mp3 files (using a spaceless pathname) and the result contained the metadata and cover art unfortunately it doesn't include a chapter list in the mp3 😞