Skip to content

Instantly share code, notes, and snippets.

@ShigekiKarita
Last active August 29, 2015 14:17
Show Gist options
  • Save ShigekiKarita/51225aecb7ca68cd820f to your computer and use it in GitHub Desktop.
Save ShigekiKarita/51225aecb7ca68cd820f to your computer and use it in GitHub Desktop.
FLAC to MP3 converter
# convert extension
mv_ext() {
for nm in *.${1}; do
mv $nm ${nm%.${1}}.${2};
done
}
# ffmpeg required
flac2mp3() {
1=${1:-"128"}
2=${2:-"*.flac"}
find . -name "*.flac" -exec ffmpeg -i {} -ab ${1}k {}.mp3 \;
mv_ext flac.mp3 mp3 # fix extension
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment