[linux] Re: .wav to .mp3

Gijs Hillenius gijs op hillenius.net
Vr mei 22 09:59:08 CEST 2009


Neem me aub niet kwalijk als ik iets per ongelijk herhaal. Dit is het
script dat ik hiervoor toepas. Gevonden op internet, al lang terug.


#!/bin/sh
#
# file: /ape-encode
#
clear
echo "Starting WAV->MP3 coding... (all .wav files in current directory)"
files=`eval expr 0`
srt=`date +%s`
for inpfile in *.wav
do

 end=`eval expr length \"$inpfile\"`
 echo prosessing file \'$inpfile\'...
 echo Filename: $end characters
 end=`eval expr $end - 3`

 outfile=`eval expr substr \'$inpfile\' 1 $end`mp3
 if test -e "$outfile"
 then
   echo Hmm... Target file $outfile already exists.
   echo Skipping this one...
 else
  lame --preset extreme "$inpfile" "$outfile"
  files=`eval expr \"$files\" + 1`
 echo
fi
done
stp=`date +%s`
runt=`eval expr \"$stp\" - \"$srt\"`
runt=`eval expr $runt / 60`
echo
echo $files "file(s) processed in "$runt minutes
echo MP3 coding job completed!
-- 
Sodd's Second Law:
	Sooner or later, the worst possible set of circumstances is
	bound to occur.



More information about the Linux mailing list