forked from funcwj/setk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_auxiva.sh
executable file
·55 lines (38 loc) · 1.32 KB
/
run_auxiva.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# wujian@2018
set -eu
cmd="run.pl"
nj=40
epochs=20
fs=16000
stft_conf=conf/stft.conf
echo "$0 $@"
function usage {
echo "Options:"
echo " --nj <nj> # number of jobs to run parallel, (default=40)"
echo " --cmd <run.pl|queue.pl> # how to run jobs, (default=run.pl)"
echo " --stft-conf <stft-conf> # stft configurations files, (default=conf/stft.conf)"
echo " --epochs <epochs> # number of epochs to run AuxIVA, (default=20)"
echo " --fs <fs> # sample frequency for output wave, (default=16000)"
}
. ./path.sh || exit 1
. ./utils/parse_options.sh || exit 1
[ $# -ne 2 ] && echo "Script format error: $0 <wav-scp> <dst-dir>" && usage && exit 1
wav_scp=$1
dst_dir=$2
[ ! -d $dst_dir ] && mkdir -p $dst_dir
dirname=$(basename $dst_dir)
exp_dir=exp/auxiva/$dirname && mkdir -p $exp_dir
split_wav_scp=""
for n in $(seq $nj); do split_wav_scp="$split_wav_scp $exp_dir/wav.$n.scp"; done
./utils/split_scp.pl $wav_scp $split_wav_scp || exit 1
stft_opts=$(cat $stft_conf | xargs)
mkdir -p $dst_dir
$cmd JOB=1:$nj $exp_dir/log/run_auxiva.JOB.log \
./scripts/sptk/apply_auxiva.py \
--sample-frequency $fs \
--num-epochs $epochs \
$stft_opts \
$exp_dir/wav.JOB.scp \
$dst_dir
echo "$0: Do auxiva for $wav_scp done"