ref: c1a707427fbbb5129e467516fc671e976ee3e398
dir: /flac2mp3/
#!/bin/rc # Convert FLAC to MP3 using lame. # This program is intended to run on a UNIX-like operating system. # Usage: Running flac2mp3 converts files in the current directory. # Dependencies: # https://lame.sourceforge.net # https://9fans.github.io/plan9port/ for(i in *.flac){ file=`{echo $"i | sed 's/[^a-zA-Z0-9]/_/g; s/_flac$/\.flac/g'} if(! ~ $file $i){ cp $"i $file && rm -f $"i } flac -d $file } for(i in *.wav){ lame -b 320 $i && rm -f $i && mv $i.mp3 mp3/ }