Skip to content

Instantly share code, notes, and snippets.

@lfzawacki
Last active Aug 29, 2015
Embed
What would you like to do?
convertmp3
#!/bin/bash
# Convert lots of *.flac into *.mp3 for consumption in devices without flac support
# Usage is:
# $ cd yourflacfolder
# $ convertmp3
# Files will be created in a new directory
MP3DIR="`basename \"$PWD\"` - mp3"
mkdir -p "$MP3DIR"
for f in *.flac;
do
flac -d "$f" "${f%.flac}.wav";
mv "${f%.flac}.wav" "$MP3DIR/"
done
cd "$MP3DIR"
for f in *.wav;
do
lame --preset fast extreme "$f" "${f%.wav}.mp3";
rm "$f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment