#!/bin/bash if [ -z "${1}" ] || [ -z "${2}" ] || [ -z "${3}" ] || [ "${1}" = "${2}"] then echo "Usage: chng-vol.sh Input_File Output_File Volume" exit 1 fi if ! [ -f "${1}" ] then echo "File ${1} not found" exit 1 fi NAME=$( basename "${1}" .sln ) if [ "${NAME}.sln" = "${1}" ] then sox -v "${3}" -t raw -r 8000 -e signed-integer -b 16 -c 1 "${1}" -t raw -r 8000 -e signed-integer -b 16 -c 1 "${2}" else NAME=$( basename "${1}" .wav ) if [ "${NAME}.wav" = "${1}" ] then sox -v "${3}" "${1}" "${2}" else echo "File ${1} is not Sln or Wav" fi fi