Script wav2mp3.sh

From campisano.org
Jump to navigation Jump to search
#!/bin/bash



echo
echo converte il file .wav specificato in file .mp3
echo se non è stato specificato nessun file,
echo converte i file .wav presenti nella dir corrente in file .mp3
echo


if [ -n "$1" ]; then
	echo
	fileName="`echo $1 | cut -f 1 -d .`.mp3";
	nice -5 lame --vbr-new -h -V 3 -B 160 "$1" "$fileName";
	ls -lh "$fileName";
	echo
else
	sleep 3s

	for I in *.wav ; do
		nice -5 lame --vbr-new -h -V 3 -B 160 "$I" "`echo $I | cut -f 1 -d .`.mp3";
	done

	echo
	ls -lh *.mp3
	echo

fi;

# End