1
0
Fork 0
scripts/resampletocdq.sh

27 lines
628 B
Bash
Executable File

#!/bin/bash
# ===============================================================
# Script for resampling flac/wav files to cd resolution
#
# Dependencies: SoX
# ===============================================================
read -p 'Gain db [0]: ' GAIN
if [[ -z "$GAIN" ]]; then
GAIN=0
fi
read -p 'Format of source is wav? [flac]: ' FORMAT
mkdir -p resampled
if [[ -z "$FORMAT" ]]; then
for file in *.flac; do
sox -V3 "$file" -b 16 "resampled/${file/%flac/wav}" gain "$GAIN" rate -v 44100 dither -s
done
else
for file in *.wav; do
sox -V3 "$file" -b 16 "resampled/$file" gain "$GAIN" rate -v 44100 dither -s
done
fi