#!/bin/bash if ! [ -f "${1}" ] then echo "File ${1} not found" exit 1 fi NAME=$( basename "${1}" .hsr.wav ) if ! [ -f "${NAME}.hsr.wav" ] then echo "File ${NAME}.hsr.wav not found" exit 1 fi echo "Reducing sample rate of ${1}" # Convert to wav if [ -n "${2}" ] then # Volume echo "Adjusting volume by ${2}" sox -v "${2}" "${1}" -t wav -r 8000 -e signed-integer -b 16 -c 1 "${NAME}.wav" highpass 300 lowpass 3400 else sox "${1}" -t wav -r 8000 -e signed-integer -b 16 -c 1 "${NAME}.wav" highpass 300 lowpass 3400 fi # Convert to sln sox "${NAME}.wav" -t raw -r 8000 -e signed-integer -b 16 -c 1 "${NAME}.sln"