React Quick Start
- Chrome & Chromium-based browsers
- Picovoice Account and AccessKey
- Node.js 16+
- React 17.0+
Picovoice Account & AccessKey
Signup or Login to Picovoice Console to get your
Make sure to keep your
Install the npm packages:
Cheetah, you'll need a Cheetah model file (
.pv). Place the model file in the project's public directory or generate a base64 representation of the file using the built-in script:
cheetahModel object with either of the methods above:
Import and call the
useCheetah Hook, and initialize
Cheetah with your
Cheetah React binding uses WebVoiceProcessor to record audio. To start recording and processing audio, call
stop to stop recording and processing audio:
Allocated resources are automatically freed on unmount, but can also be done explicitly:
Create custom models using the Picovoice Console.
Train and download a Cheetah speech-to-text model (
.pv) for the target platform
This model file can be used directly with
publicPath, but, if
base64 is preferable, convert the
.pv file to a base64
Model files (
.pv) are saved in IndexedDB to be used by Web Assembly.
publicPath must be set to instantiate Cheetah.
If both are set, Cheetah will use the
For the Cheetah React SDK, there is a React demo project available on the Cheetah GitHub repository.
Clone the Cheetah repository from GitHub:
- Install dependencies:
- Run the demo with the
Open http://localhost:3000 to view it in the browser.
Enter your access key and press on
Init Cheetahto start recording for keyword detections.