ref: c1a707427fbbb5129e467516fc671e976ee3e398
dir: /alac2mp3/
#!/bin/rc # Convert ALAC to MP3 using mplayer and lame, then delete the ALAC files. # This program is intended to run on a UNIX-like operating system. # Usage: Running alac2flac converts files in the current directory. # The -r flag recurses into subdirectories. # Dependencies: # http://www.mplayerhq.hu/design7/dload.html # https://lame.sourceforge.io/ # https://9fans.github.io/plan9port/ # http://plan9.stanleylieber.com/rc/crip rfork e path=$PLAN9/bin:$PATH formats='m4a|M4A' fn walk{ du $1 | awk '{print $2}' | sed 's/^\./'^$"1^'/'} if(~ $1 -r){ for(i in `{walk `{pwd} | sort -f}){ echo $"i && cd $"i && alac2mp3} exit } if(ls | grep -s -e $"formats){ crip -n # normalize file names for plan 9 for(i in `{ls | grep -e $"formats}){ mplayer -quiet -vo null -vc dummy \ -af volume'='0,resample'='44100:0:1 \ -ao pcm:waveheader:file'='$"f.wav $"i && lame --quiet -m -s -h -b 320 -V0 --vbr-new $"f.wav $"f.mp3 && rm -f $"f.wav } }