Porcupine Wake Word
Vue Quick Start
Compatibility
- Chrome & Chromium-based browsers
- Edge
- Firefox
- Safari
Requirements
- Picovoice Account and AccessKey
- Node.js 16+
- Vue 2.6.11+, 3.0.0+
- npm
Picovoice Account & AccessKey
Signup or Login to Picovoice Console to get your AccessKey
.
Make sure to keep your AccessKey
secret.
Quick Start
Setup
Install Node.js.
Install the npm packages:
Usage
Put the model file in the project's public directory or generate a base64 model using the build in script:
Create a porcupineModel
object with either of the methods above:
Create a Vue Component that detects the built-in keywords porcupine
and bumblebee
:
To learn how to use PorcupineVue
with Vue's Composition API, check Porcupine Wake Word Vue GitHub Repo.
The binding will take care of microphone access and audio down-sampling (
via @picovoice/web-voice-processor
).
To start audio processing:
To stop audio processing:
Clean up resources explicitly with:
Custom Keywords
Create custom keywords using the Picovoice Console.
Train and download a Porcupine Wake Word keyword model (.ppn
) for the target platform Web (WASM)
.
This model file can be used directly with publicPath
, but, if base64
is preferable, convert the .ppn
file to a base64
JavaScript variable using the built-in pvbase64
script:
Similar to the model file (.pv
), keyword files (.ppn
) are saved in IndexedDB to be used by Web Assembly.
Either base64
or publicPath
must be set for each keyword to instantiate Porcupine Wake Word.
If both are set, Porcupine Wake Word will use the base64
model.
An arbitrary label
is required to identify the keyword once the detection occurs.
Then, initialize an instance of Porcupine Wake Word
:
Non-English Languages
In order to use Porcupine Wake Word with other languages, you need to use the corresponding model file (.pv
) for the desired language. The model files for all
supported languages are available on the Porcupine Github repository.
Demo
For the Porcupine Wake Word Vue SDK, there is a Vue demo project available on the Porcupine GitHub repository.
Setup
Clone the Porcupine Wake Word repository from GitHub:
Usage
- Install the dependencies and use the
start
script with a language code to start the demo in the language of your choice (e.g.de
-> German,ko
-> Korean). To see a list of available languages, runstart
without a language code.
- Open the link provided by the command-line output to launch the demo in your browser.
Resources
Packages
- @picovoice/porcupine-vue on the npm registry
- @picovoice/porcupine-web on the npm registry
- @picovoice/web-voice-processor on the npm registry