This is a small websocket server that expects audio chunks and sends out the Cerence cloud request for ASR recognition. It uses the library github.com/acepero13/cloud-client-go.
This app opens the port 2701 and listens to messages sent via websocket to that port. It expects raw audio data (ex. taken from a microphone) and connects to cerence cloud server and notifies the client with the recognition
Make sure that you have the corresponding files inside the configs folder. There you should place the server certificates (if you want to connect using TLS), and the configuration files (json) needed to connect to the Cerence server.
-
Set up your local development environment for Go. You can follow this tutorial How To Install Go and Set Up a Local Programming Environment
-
In a terminal, execute the following command:
go get https://github.com/acepero13/asr-server-cer
. This will install the asr-server into your$GOPATH
-
Go to
$GOPATH/bin
and copy the configs folder that contains the asr configuration files for connecting to cerence -
In
$GOPATH/bin
execute:./asr-server-cer
Build image
docker build -t asr-server-cer .
Run Docker image
docker run -it --rm -p 2701:2701 --net=host asr-server-cer:latest
You can also specify arguments to change the default configuration of the server. For example, if you want to run the server on a different port other than 2701, or you do not want to use encrypted communication.
Run Docker image with arguments
docker run -it --rm -p 5005:5005 --net=host asr-server-cer:latest --port 5005 --no-tls
Arguments
--port value port to start listening for raw audio data (default: 2701)
--no-tls if present, uses an insecure communication protocol (ws) (default: false)
Can't open config file: open configs/asr_sem_X.json: no such file or directory
In case you see this error, it means that you are missing a config file. To fix it go to the configs folder and paste the missing config file for communicating with cerence
In case you find a problem, please create an issue for it.