audio_edit / install.sh
HoneyTian's picture
update
d8a15c9
#!/usr/bin/env bash
# bash install.sh --stage 1 --stop_stage 1 --system_version windows
system_version="centos";
verbose=true;
stage=-1
stop_stage=0
# parse options
while true; do
[ -z "${1:-}" ] && break; # break if there are no arguments
case "$1" in
--*) name=$(echo "$1" | sed s/^--// | sed s/-/_/g);
eval '[ -z "${'"$name"'+xxx}" ]' && echo "$0: invalid option $1" 1>&2 && exit 1;
old_value="(eval echo \\$$name)";
if [ "${old_value}" == "true" ] || [ "${old_value}" == "false" ]; then
was_bool=true;
else
was_bool=false;
fi
# Set the variable to the right value-- the escaped quotes make it work if
# the option had spaces, like --cmd "queue.pl -sync y"
eval "${name}=\"$2\"";
# Check that Boolean-valued arguments are really Boolean.
if $was_bool && [[ "$2" != "true" && "$2" != "false" ]]; then
echo "$0: expected \"true\" or \"false\": $1 $2" 1>&2
exit 1;
fi
shift 2;
;;
*) break;
esac
done
work_dir="$(pwd)"
data_dir="${work_dir}/data/impulse_responses"
mkdir -p "${data_dir}"
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
$verbose && echo "stage 1: download simulated room impulse responses"
cd "${data_dir}" || exit 1;
# https://www.openslr.org/26/
# wget https://www.openslr.org/resources/26/sim_rir_8k.zip
# unzip sim_rir_8k.zip
wget https://www.openslr.org/resources/26/sim_rir_16k.zip
unzip sim_rir_16k.zip
# https://www.openslr.org/28/
# wget https://www.openslr.org/resources/28/rirs_noises.zip
# unzip rirs_noises.zip
fi