forked from macide213/nvidia-kaldi-gstreamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
42 lines (34 loc) · 1009 Bytes
/
start.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
#!/bin/bash
MASTER="localhost"
PORT=80
usage(){
echo "Creates a worker and connects it to a master.";
echo "If the master address is not given, a master will be created at localhost:80";
echo "Usage: $0 -y yaml_file [-m master address] [-p port number]";
}
while getopts "h?m:p:y:" opt; do
case "$opt" in
h|\?)
usage
exit 0
;;
m) MASTER=$OPTARG
;;
p) PORT=$OPTARG
;;
y) YAML=$OPTARG
;;
esac
done
#yaml file must be specified
if [ -z "$YAML" ] || [ ! -f "$YAML" ] ; then
usage;
exit 1;
fi;
if [ "$MASTER" == "localhost" ] ; then
# start a local master
python /opt/kaldi-gstreamer-server/kaldigstserver/master_server.py --port=$PORT 2>> /opt/master.log &
fi
#start worker and connect it to the master
export GST_PLUGIN_PATH=/opt/gst-kaldi-nnet2-online/src/:/opt/kaldi/src/gst-plugin/
python /opt/kaldi-gstreamer-server/kaldigstserver/worker.py -c $YAML -u ws://$MASTER:$PORT/worker/ws/speech 2>> /opt/worker.log &