Client

With the client you can record your voice in real-time, send it to the server, and get the recognition results back from the server.

We provide a web client for this purpose.

Caution

Please first start the Server before you start the client.

Also, we have hard coded the server port to 6006. Please either pass --port 6006 when starting the server or change the client https://github.com/k2-fsa/sherpa/blob/master/sherpa/bin/web/js/streaming_record.js#L21 to use whaterver the port the server is using.

Usage

cd /path/to/sherpa
cd ./sherpa/bin/web
python3 -m http.server 6008

Then open your browser, and visit http://localhost:6008/record.html.

You will see a UI like the following screenshot. Click the Record button and speak! You should see the recognition results from the server.

Screen shot of the web client user interface

Note

If you are unable to click the Record button, please make sure the server port is 6006.

Caution

You have to visit http://localhost:6008/record.html, not http://0.0.0.0:6008/record.html. Otherwise, you will not be able to use the microphone in the browser. One way to avoid this is to use https, but that needs a certificate.

Hint

If you are using Chrome, you can right click the page, and then click inspect in the popup menu, and then click console. You will see some diagnostic message. This helps you to debug if you are unable to click the Record button.

The following is a YouTube video, demonstrating the results.

Note

If you have no access to YouTube, please visit the following link from bilibili https://www.bilibili.com/video/BV1BU4y197bs