Convert m4a to mp3
$ sudo apt-get install ffmpeg
$ vi m4a-mp3.sh
#!/bin/sh
for m4a in *.m4a; do
mp3=`echo "$m4a" | sed -e 's/m4a$/mp3/'`
if [ ! -e "$mp3" ]; then
ffmpeg -i "$m4a" -acodec libmp3lame -ab 256k "$mp3"
test -s "$mp3" && rm "$m4a"
fi
done
$ chmod +x m4a-mp3.sh
$ ./m4a-mp3.sh
Convert flac to mp3
$ sudo apt-get install ffmpeg
$ vi flac-mp3.sh
#!/bin/bash
for a in ./*.flac; do
ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}"
done
$ chmod +x flac-mp3.sh
$ ./flac-mp3.sh
Convert legacy ID3 tags
$ sudo apt-get install python-mutagen
$ mid3iconv -e cp1251 ~/mp3/*