[relug] Re: De Discobus Compactobus

  • From: Daniele Torelli <torelizer@xxxxxxxxxxx>
  • To: relug@xxxxxxxxxxxxx
  • Date: Thu, 24 Apr 2003 12:11:23 +0200

anzi, leggendo meglio la pagina vi conviene tirarvi giù quest'altro script, 
vedete un po' se fa al caso vostro...

The second script is slightly more complicated, and somewhat more useful. It 
converts every .mp3 file in the current directory to a .wav file of the same 
name in /var/cdrom, which is the directory I've set up for Xcdroast to use when 
burning CDs. To use it, just change to the right directory, and type:

allmp3wav


#!/bin/bash
# allmp3wav
for i in *.mp3; do
     echo "$i"
     tgt=$(echo "$i" | sed -e "s/mp3/wav/")
     mpg123 -b 10000 -s -r 44100 "$i" | sox -t raw -r 44100 -s -w -c2 - 
/var/cdrom/"$tgt"
done

può essere anche divertente guardarci dentro, ah, la leggibilità del bash!:)

Other related posts: