Skip to content

Instantly share code, notes, and snippets.

@Moanrisy
Created March 12, 2024 03:06
Show Gist options
  • Save Moanrisy/f07bc667a41303d9de60061b906ac0a6 to your computer and use it in GitHub Desktop.
Save Moanrisy/f07bc667a41303d9de60061b906ac0a6 to your computer and use it in GitHub Desktop.
Convert m4b audiobook into mp3
#!/bin/bash
# Loop through all .m4b files in the current directory
for file in *.m4b; do
# Get the filename without extension
filename=$(basename -- "$file")
filename="${filename%.*}"
# Run ffmpeg command to convert .m4b to .mp3
ffmpeg -i "$file" -acodec libmp3lame -ar 22050 "${filename}.mp3"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment