soxをインストール
brew install sox
スクリプト
normalize.zsh
# !/bin/zsh
# NEED sox
# brew install sox
EXPORT_DIR=normalized
# input folder
function mkdir_ex() {
# create folder
if [ ! -d $1 ]
then
mkdir $1
fi
}
# normalize
function normalize() {
sox $1 $EXPORT_DIR/$1 norm -1
}
mkdir_ex $EXPORT_DIR
while [ "$1" != "" ]
do
normalize $1
shift
done
使い方
usage.zsh
./normalize.zsh *.aif