Feeds:
Articles
Commentaires

Archive for décembre 2010

This small script below is a work in progress, still very useful in its present form… It rips from Audio CDs in wav format. If you start from other formats like flac, this will convert them easily to wav.
Then a basic way to encode in mp3 but most important to ogg with a decent information tag.
Finally, my way to remove special characters from file names.
The comment option in oggenc doesn’t work properly (unless you use "=" in the text)… If you want to add a comment, use easytag to do so… This will help creating a playlist.m3u as well.

#!/bin/sh
# from Audio CD :
# cdparanoia -B
#
# APE/FLAC/AMR/other to WAV :
# for i in *.flac ; do mplayer "$i" -ao pcm:file="${i%.flac}.wav" ; done
#
# Encode to MP3 :
# for i in *.wav; do lame -b 192 "$i" "${i%.wav}.mp3" ; done
#
# Encode to OGG :
oggenc -q8 –name-remove " (‘;:,!?+)" –name-replace "_-_–" –names "%n_%t.ogg" \
–artist "HILDEGARD VON BINGEN (1098-1179)" \
–genre "Classical" \
–date "1983" \
–album "A feather on the breath of God" \
–tracknum "01" –title "Columba aspexit" *01*.wav \
–tracknum "02" –title "Ave, generosa" *02*.wav \
–tracknum "03" –title "O ignis spiritus" *03*.wav \
–tracknum "04" –title "O Ierusalem" *04*.wav \
–tracknum "05" –title "O Euchari" *05*.wav \
–tracknum "06" –title "O viridissima virga" *06*.wav \
–tracknum "07" –title "O presul vere civitas" *07*.wav \
–tracknum "08" –title "O Ecclesia" *08*.wav
#
# Remove special characters :
for i in *.ogg ;
do mv $i `echo $i | sed ‘s/_-_/-/g ; s/_-/-/g ; s/-_/-/g ; \
s/É\|È\|Ê\|Ë/E/g ; s/é\|è\|ê\|ë/e/g ; \
s/Ú\|Ù\|Û\|Ü/U/g ; s/ú\|ù\|û\|ü/u/g ; \
s/Í\|Ì\|Î\|Ï/I/g ; s/í\|ì\|î\|ï/i/g ; \
s/Á\|À\|Â\|Ä\|Å\|Ã/A/g ; s/á\|à\|â\|ä\|å\|ã/a/g ; \
s/Ó\|Ò\|Ô\|Ö\|Ø\|Õ/O/g ; s/ó\|ò\|ô\|ö\|ø\|õ/o/g ; \
s/Ç/c/g ; s/ç/c/g ; \
s/Ñ/N/g ; s/ñ/n/g ; \
s/Ÿ/Y/g ; s/ÿ/y/g’` ;
done

Publicités

Read Full Post »