wasmPorcupine - Web Quick Start

  • Wake Word Detection
  • Offline Hotword Detection
  • Always Listening
  • Voice Activation
  • Web
  • WebAssembly

Compatibility

  • Chrome, Edge
  • Firefox
  • Safari

Requirements

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

Installing WebVoiceProcessor and a Worker package

Using Porcupine 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/porcupine-web-en-worker).

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

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

(or)

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

Demo application

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

Clone Porcupine GitHub repository

If using SSH, clone the Porcupine repository with:

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

If using HTTPS, then type:

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

Install dependencies and run

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

cd porcupine/demo/web
yarn
yarn start

(or)

cd porcupine/demo/web
npm install
npm run start

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

Try Porcupine

This demo runs four Porcupine workers simultaneously, one for each of four languages (English, French, German, and Spanish).

Try the following phrases:

English:

"Picovoice"

"Papaya Whip"

German:

"Ananas"

French:

"Framboise"

Spanish:

"Manzana"

Custom Wake Words

You can create custom Porcupine wake word models using Picovoice Console. Making Porcupine wake word models for the Web platform requires an Enterprise account.


Issue with this doc? Please let us know.