Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ m4bify [--help] [-d | --chapters-from-dirs] [-b <bitrate> | --bitrate <bitrate>]
**Options**

- `-d`, `--chapters-from-dirs`: Treats each top-level subdirectory as a chapter.
- `-b <value>`, `--bitrate <value>`: Sets the audio encoding bitrate (e.g. "128k", default: VBR Very High).
- `-b <value>`, `--bitrate <value>`: Sets the audio encoding bitrate. Supported values:
- `<num>k` - Fixed bitrate (e.g. "32k", "128k")
- `vbr` - VBR Very High
- `alac` - [Apple Lossless Audio Codec](https://en.wikipedia.org/wiki/Apple_Lossless_Audio_Codec)
- `--help`: Displays usage instructions and exits.

**Arguments**
Expand Down
10 changes: 8 additions & 2 deletions m4bify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,11 @@ function print_usage {
echo -e " ${COLORS[ARGS]}-d, --chapters-from-dirs${NC} Treats each top-level subdirectory as a chapter."
echo -e " Files within each chapter directory (including nested ones)"
echo -e " are discovered recursively and processed alphabetically."
echo -e " ${COLORS[ARGS]}-b, --bitrate <value>${NC} Desired audio bitrate for the output, e.g., \"128k\" or \"96k\"."
echo -e " Defaults to VBR Very High quality (~96-192 kbps)."
echo -e " ${COLORS[ARGS]}-b, --bitrate <value>${NC} Desired audio bitrate for the output."
echo -e " Supported values:"
echo -e " - ${COLORS[ARGS]}<num>k${NC} - Fixed bitrate (e.g. 32k, 128k)"
echo -e " - ${COLORS[ARGS]}vbr${NC} - VBR Very High (~96-192 kbps)"
echo -e " - ${COLORS[ARGS]}alac${NC} - Apple Lossless Audio Codec"
echo -e " ${COLORS[ARGS]}--help${NC} Display this help message and exit."
echo -e ""
echo -e "${COLORS[TITLE]}Arguments:${NC}"
Expand Down Expand Up @@ -223,6 +226,9 @@ function convert {
quality="-q:a ${AAC_VBR_PROFILE}"
echo -e "${COLORS[ACTION]}Encoding '${path_info}' [${codec} vbr ${AAC_VBR_PROFILE}]...${NC}"
fi
elif [[ "${bitrate}" == "alac" ]]; then
codec="alac"
echo -e "${COLORS[ACTION]}Encoding '${path_info}' [alac]...${NC}"
else
quality="-b:a ${bitrate}"
echo -e "${COLORS[ACTION]}Encoding '${path_info}' [${codec} cbr ${bitrate}]...${NC}"
Expand Down