@picovoice/cheetah-node
v2.1.0
Published
Picovoice Cheetah Node.js binding
Downloads
172
Readme
Cheetah Binding for Node.js
Cheetah Speech-to-Text Engine
Made in Vancouver, Canada by Picovoice
Cheetah is an on-device streaming speech-to-text engine. Cheetah is:
- Private; All voice processing runs locally.
- Accurate [1]
- Compact and Computationally-Efficient [2]
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)
Compatibility
- Node.js 16+
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), and Raspberry Pi (3, 4, 5).
Installation
npm install @picovoice/cheetah-node
AccessKey
Cheetah requires a valid Picovoice AccessKey
at initialization. AccessKey
acts as your credentials when using Cheetah SDKs.
You can get your AccessKey
for free. Make sure to keep your AccessKey
secret.
Signup or Login to Picovoice Console to get your AccessKey
.
Usage
Create an instance of the engine and transcribe audio :
const {Cheetah} = require("@picovoice/cheetah-node");
const accessKey = "${ACCESS_KEY}"; // Obtained from the Picovoice Console (https://console.picovoice.ai/)
const endpointDurationSec = 2.0;
const handle = new Cheetah(accessKey);
function getNextAudioFrame() {
// ...
return audioFrame;
}
while (true) {
const audioFrame = getNextAudioFrame();
const [partialTranscript, isEndpoint] = handle.process(audioFrame);
if (isEndpoint) {
finalTranscript = handle.flush()
}
}
Replace ${ACCESS_KEY}
with yours obtained from Picovoice Console. Finally, when done be sure to explicitly release the resources using
handle.release()
.
Language Model
The Cheetah Node.js SDK comes preloaded with a default English language model (.pv
file).
Default models for other supported languages can be found in lib/common.
Create custom language models using the Picovoice Console. Here you can train language models with custom vocabulary and boost words in the existing vocabulary.
Demos
Cheetah Node.js demo package provides command-line utilities for processing audio using cheetah.