#!/usr/bin/env zsh # apply replay gain tags to files in ${1} setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL setopt CSHNULLGLOB # remove non-matching globs but cancel if nothing matches local dir=${1} rsgain custom \ --album \ --tagmode=i \ --loudness=-18 \ --clip-mode=p \ --id3v2-version=keep \ --opus-mode=d \ --preserve-mtimes \ ${dir}/*.{flac,mp3,m4a,opus,ogg,oga,wma,wav,wv,aiff,ape}