Skip to content

Instantly share code, notes, and snippets.

@chrisvoo
Last active December 10, 2022 20:03
Show Gist options
  • Save chrisvoo/b741f7b11d63c2aae3baa10f032938fd to your computer and use it in GitHub Desktop.
Save chrisvoo/b741f7b11d63c2aae3baa10f032938fd to your computer and use it in GitHub Desktop.
Converts a FLAC file to MP3 with ffmpeg and lame encoder
to_mp3() {
filename=$(basename "$1")
extension="${filename##*.}"
filename="${filename%.*}"
ffmpeg -i "$1" -codec:a libmp3lame -b:a 320k -map_metadata 0 -id3v2_version 3 ${filename}.mp3
}
@chrisvoo
Copy link
Author

chrisvoo commented Jul 4, 2017

Pass the full (or relative) path of your FLAC file to the function. The result will be an MP3 named ad your FLAC original file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment