Cheetah Speech-to-Text
React Quick Start
Platforms
- Chrome & Chromium-based browsers
- Edge
- Firefox
- Safari
Requirements
- Picovoice Account and AccessKey
- Node.js 16+
- React 17.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
Download a custom model from Picovoice Console or use the default model file. Place the model file in the project's public directory or generate a base64 representation of the file using the built-in script:
Create a cheetahModel
object with either of the methods above:
Import and call the useCheetah
Hook, and initialize Cheetah Streaming Speech-to-Text
with your AccessKey
and cheetahModel
:
Cheetah Streaming Speech-to-Text React binding uses WebVoiceProcessor to record audio. To start recording and processing audio, call start
:
Call stop
to stop recording and processing audio:
Allocated resources are automatically freed on unmount, but can also be done explicitly:
Demo
For the Cheetah Streaming Speech-to-Text React SDK, there is a React demo project available on the Cheetah Streaming Speech-to-Text GitHub repository.
Setup
Clone the Cheetah Streaming Speech-to-Text repository from GitHub:
Usage
- Install dependencies:
- Run the demo with the
start
script:
Open http://localhost:3000 to view it in the browser.
Enter your access key and press on
Init Cheetah
to start recording for keyword detections.
Resources
Package
API
GitHub
- Cheetah Streaming Speech-to-Text React SDK on GitHub
- Cheetah Streaming Speech-to-Text React Demo on GitHub