Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

FLAC to MP3 script

The following Script will decode the Flac files in wav and then encode them in mp3.

1. First we install flac and lame library:

sudo apt-get install flac lame


2. Open a file:

sudo nano /bin/flac2mp3


3. You'll now need to make it executable:



4. Paste the following script:

# Encode
# v0.1 17.08.08 - First created
# Darren O'Connor

# This script, when run in a folder full of FLAC files, will create high quality VBR mp3's for use in mp3 players.
# This version uses lame 3.98. If you use version 3.97 and below you'll need to change a few options

#!/bin/bash
mkdir wav/
flac -d *.flac
mv *.wav wav/
cd wav/
for f in *.wav; do mv "$f" "${f%.wav}";done
mkdir ../mp3/
find -maxdepth 1 -type f -name '*' -exec lame -V0 -q0 '{}' -o '../mp3/{}' \;
cd ../mp3/
for FILE in *; do mv "$FILE" "$FILE.mp3"; done
cd ../
rm -r wav/


5. How to use:

we navigate to out directory containing .flac files and run

sudo flac2mp3


after everything was encoded, you will see a subdirectory called mp3. those are the files you need.

Resources: ubuntuforums


This post first appeared on Ubuntu Tutorials, please read the originial post: here

Share the post

FLAC to MP3 script

×

Subscribe to Ubuntu Tutorials

Get updates delivered right to your inbox!

Thank you for your subscription

×