12345678910111213141516171819202122232425262728 |
- #!/bin/zsh -f
- case $1 in
- m4a)
- for song in *.m4a ;
- do
- NEW=`basename -- "$song" .m4a`.ogg
- if [[ -e $NEW ]] ; then
- echo "Skipping ${NEW}, already converted."
- else
- faad -w -- "$song" | oggenc -o "${NEW}" -
- fi
- done
- ;;
- mp3)
- for song in *.mp3 ;
- do
- NEW=`basename -- "$song" .mp3`.ogg
- if [[ -e $NEW ]] ; then
- echo "Skipping ${NEW}, already converted."
- else
- sox ${song} ${NEW}
- fi
- done
- ;;
- *)
- echo Nothing to do
- esac
|