Convert .flac music files to .mp3 on osx

Convert .flac music files to .mp3 on osx

By David WORMS

Jul 20, 2012

Categories: Hack | Tags: File Format, OS X

As an osx user for years now, one should know by then that iTunes doesn’t support the flac format. We are now in 2012, I’ve been waiting for this to happen since years know. Loosing patience, dark time for Apple. In the meantine, for the record, here a how to convert flac files into an mp3 format.

After preparing our system, we’ll be left with a single shell command which will look for all the .flac file inside a current working directory and generate a copy of the same name with a mp3 extension.

Requirements

Quite simple, you’ll need macport installed which itself need an xcode installation (with developer tools if i’m not mistaken).

Installation

We need to install two commands which are flac and lame.

sudo port install flac
sudo port install lame

Running

Open the terminal, use cd ... to place yourself into the directory holding your .flac files and finally run:

for file in *.flac; do $(flac -cd "$file" | lame --preset fast extreme - "${file%.flac}.mp3"); done

Canada - Morocco - France

International locations

10 rue de la Kasbah
2393 Rabbat
Canada

We are a team of Open Source enthusiasts doing consulting in Big Data, Cloud, DevOps, Data Engineering, Data Science…

We provide our customers with accurate insights on how to leverage technologies to convert their use cases to projects in production, how to reduce their costs and increase the time to market.

If you enjoy reading our publications and have an interest in what we do, contact us and we will be thrilled to cooperate with you.