Skip to content

Instantly share code, notes, and snippets.

@raduchiriac
Last active August 2, 2019 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raduchiriac/b88045ca006d4f6dcf2a1147ac6c8bb6 to your computer and use it in GitHub Desktop.
Save raduchiriac/b88045ca006d4f6dcf2a1147ac6c8bb6 to your computer and use it in GitHub Desktop.
Basic workflow for converting FLAC and WAV files to MP3 straight from the context menu
# Make sure you have ffmpeg installed (`brew install ffmpeg`)
#!/bin/bash
for f in "$@";
do
if [[ $f == *.flac ]]; then
/usr/local/bin/ffmpeg -i "$f" -vn -ab 320k -map_metadata 0 -id3v2_version 3 "${f%.flac}.mp3"
fi
if [[ $f == *.wav ]]; then
/usr/local/bin/lame -q 0 -b 320 "$f"
fi
if [[ $f == *.aiff ]]; then
/usr/local/bin/lame -q 0 -b 320 "$f"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment