shithub: rc

ref: c1a707427fbbb5129e467516fc671e976ee3e398
dir: /flac2alac/

View raw version
#!/bin/rc
# Convert FLAC to ALAC using ffmpeg.
# This program is intended to run on a UNIX-like operating system.
# Usage: Running flac2alac converts files in the current directory.
# Dependencies:
# https://ffmpeg.org
# 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
	}
	ffmpeg -i $file -c:a alac `{echo $file | sed 's/\.flac/\.m4a/'}
}