Skip to content

Instantly share code, notes, and snippets.

@lfzawacki
Last active August 29, 2015 14:08
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 lfzawacki/db7585d3da68506d3a87 to your computer and use it in GitHub Desktop.
Save lfzawacki/db7585d3da68506d3a87 to your computer and use it in GitHub Desktop.
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