wasmRhino - Web Quick Start

  • Web
  • WebAssembly
  • NLU


  • Chrome, Edge
  • Firefox
  • Safari


  • yarn (or npm)
  • Secure browser context (i.e. HTTPS or localhost)

Installing WebVoiceProcessor and a Worker package

Using Rhino for Web (with a microphone) requires installing two packages. The web-voice-processor package, @picovoice/web-voice-processor, and the language-specific web worker package (e.g. @picovoice/rhino-web-en-worker).

Using yarn or npm

Use yarn or npm to install the packages to your project:

yarn add @picovoice/rhino-web-en-worker @picovoice/web-voice-processor


npm install @picovoice/rhino-web-en-worker @picovoice/web-voice-processor

Using CDN / script tags

You can directly import the libraries using the IIFE version via unpkg CDN:

<script src="https://unpkg.com/@picovoice/rhino-web-en-worker/dist/iife/index.js"></script>
<script src="https://unpkg.com/@picovoice/web-voice-processor/dist/iife/index.js"></script>

This will add RhinoWebEnWorker and WebVoiceProcessor to the global scope.

Demo application

There is a Web demo project available on the Rhino GitHub repository.

Clone Rhino GitHub repository

If using SSH, clone the Rhino repository with:

git clone --recurse-submodules [email protected]:Picovoice/rhino.git

If using HTTPS, then type:

git clone --recurse-submodules https://github.com/Picovoice/rhino.git

Install dependencies and run

Use yarn or npm to install the demo dependencies and start it:

cd rhino/demo/web
yarn start


cd rhino/demo/web
npm install
npm run start

Open http://localhost:5000 to view it in the browser.

Try Rhino

The demo is running a context called "Clock" (available as a .rhn file in the GitHub repository). Press the "Push to Talk" button to start a voice interaction.

Try a phrase that is in the context:

"Set a timer for two minutes"

The results will appear on screen:

"isFinalized": true,
"isUnderstood": true,
"intent": "setTimer",
"slots": { "minutes": "10" }

Try a phrase that is out-of-context:

"What's my horoscope?"

"isFinalized": true,
"isUnderstood": false,
"intent": null,
"slots": {}

This command falls outside of the domain of "Alarm Clock" and is therefore not understood.

Demo context source

The Alarm Clock was trained to understand a particular set of expressions. These are built using a simple grammar and grouped together into a YAML file. This file is trained by Picovoice Console to create a .rhn file for the WebAssembly (WASM) platform.

- "set (a, an, the) [alarm, timer] for $pv.TwoDigitInteger:hours [hour, hours] (and) $pv.TwoDigitInteger:minutes [minute, minutes] (and) $pv.TwoDigitInteger:seconds [second, seconds]"
- "set (a, an, the) [alarm, timer] for $pv.TwoDigitInteger:hours [hour, hours] (and) $pv.TwoDigitInteger:minutes [minute, minutes]"
- "set (a, an, the) [alarm, timer] for $pv.TwoDigitInteger:hours [hour, hours] (and) $pv.TwoDigitInteger:seconds [second, seconds]"
- "set (a, an, the) [alarm, timer] for $pv.TwoDigitInteger:hours [hour, hours]"
- "set (a, an, the) [alarm, timer] for $pv.TwoDigitInteger:minutes [minute, minutes] (and) $pv.TwoDigitInteger:seconds [second, seconds]"
- "set (a, an, the) [alarm, timer] for $pv.TwoDigitInteger:minutes [minute, minutes]"
- "set (a, an, the) [alarm, timer] for $pv.TwoDigitInteger:seconds [second, seconds]"
- "$pv.TwoDigitInteger:hours [hour, hours] (and) $pv.TwoDigitInteger:minutes [minute, minutes] (and) $pv.TwoDigitInteger:seconds [second, seconds]"
- "$pv.TwoDigitInteger:hours [hour, hours] (and) $pv.TwoDigitInteger:minutes [minute, minutes]"
- "$pv.TwoDigitInteger:hours [hour, hours] (and) $pv.TwoDigitInteger:seconds [second, seconds]"
- "$pv.TwoDigitInteger:hours [hour, hours]"
- "$pv.TwoDigitInteger:minutes [minute, minutes] (and) $pv.TwoDigitInteger:seconds [second, seconds]"
- "$pv.TwoDigitInteger:minutes [minute, minutes]"
- "$pv.TwoDigitInteger:seconds [second, seconds]"
- "reset (the) (timer)"
- "[pause, stop] (the) (timer)"
- "resume (the) (timer)"

Issue with this doc? Please let us know.