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:
Non-English Languages
In order to use Cheetah 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 Cheetah GitHub repository.
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 with a language code to start a local web server hosting the demo in the language of your choice (e.g.de
-> German,es
-> Spanish). To see a list of available languages, run start without a language code.
Open http://localhost:3000 to view it in the browser.
Enter your access key and press on
Init Cheetah
. Once Cheetah Speech-to-Text has loaded, upload an audio file or record audio with a microphone to begin transcribing speech-to-text.
Resources
Package
API
GitHub
- Cheetah Streaming Speech-to-Text React SDK on GitHub
- Cheetah Streaming Speech-to-Text React Demo on GitHub