-
Notifications
You must be signed in to change notification settings - Fork 878
Adding ASR
saijel edited this page Apr 4, 2017
·
3 revisions
-
Install Lucida localling
- Refer to the Installing Local Lucida doc
-
Enforce the lucida host to be secure by attaching it to ssl certificates (this permits user input through the web page)
- Generate a self signed certificate
- Generate a private key
$openssl genrsa -des3 -out server.key 1024
- Generate a CSR
$openssl req -new -key server.key -out server.csr
- Remove Passphrase from key
$cp server.key server.key.org
$openssl rsa -in server.key.org -out server.key
- Generate self signed certificate
$openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
- Generate a private key
- Connect the certificate to the Flask app and the ASR websocket
- Flask app in /lucida/commandcenter/app.py add ssl_context:
app.run('0.0.0.0', port=3000, debug=True, use_reloader=False, threaded=True, ssl_context=('<path to server.crt>', '<path to server.key>'))
- ASR websocket in /lucida/commandcenter/app.py add ssl_options:
WebSocket.Application().listen(8081, ssl_options={“certfile”:”<path to server.crt>”, “keyfile”:“<path to server.key>”})
- Flask app in /lucida/commandcenter/app.py add ssl_context:
- Generate a self signed certificate
-
Change the host calls to secure
- In /lucida/commandcenter/controllers/Infer.py change:
options[‘asr_addr_port’] = ‘ws:localhost:8081’
to
options[‘asr_addr_port’] = ‘wss:<host IP addr>:8081’
- In the ASR terminal run (this will start a worker for the websocket)
$cd /speechrecognition/kaldi_gstreamer_asr/
$export GST_PLUGIN_PATH=$(pwd)/kaldi/tools/gst-kaldi-nnet2-online/src
$python kaldigstserver/worker.py -u wss://<host IP addr>:8081/worker/ws/speech -c sample_english_nnet2.yaml
- Wait until you see Opened websocket connection to server from the worker.
- In /lucida/commandcenter/controllers/Infer.py change: