-
Notifications
You must be signed in to change notification settings - Fork 3
/
02_prepare_acoustic_features.sh
41 lines (32 loc) · 1.04 KB
/
02_prepare_acoustic_features.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
#!/bin/bash
global_config_file=conf/global_settings.cfg
source $global_config_file
if test "$#" -lt 2; then
echo "################################"
echo "Usage:"
echo "$0 <path_to_wav_dir> <path_to_feat_dir>"
echo ""
echo "default path to wav dir(Input): database/${Source}/wav"
echo "default path to feat dir(Output): database/${Source}/feats"
echo "################################"
exit 1
fi
wav_dir=$1
feat_dir=$2
if test "$#" -eq 3; then
SamplingFreq=$3
fi
if [ ! "$(ls -A ${wav_dir})" ]; then
echo "Please place your audio files in: ${wav_dir}"
exit 1
fi
####################################
##### prepare vocoder features #####
####################################
prepare_feats=true
if [ "$prepare_feats" = true ]; then
echo "Step 2:"
echo "Prepare acoustic features using "${Vocoder}" vocoder..."
Vocoder=$(echo ${Vocoder} | tr '[A-Z]' '[a-z]')
python ${MerlinDir}/misc/scripts/vocoder/${Vocoder}/extract_features_for_merlin.py ${MerlinDir} ${wav_dir} ${feat_dir} $SamplingFreq
fi