Cheetah - Node.js Quick Start
Platforms
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- NVIDIA Jetson Nano
- Raspberry Pi (3, 4)
Requirements
- Picovoice Account & AccessKey
- Node.js 10+
- 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 cheetah-node npm package:
npm install @picovoice/cheetah-node
Usage
Create an instance of the engine:
const Cheetah = require("@picovoice/cheetah-node");const accessKey = "${ACCESS_KEY}";const cheetah = new Cheetah(accessKey);
Transcribe audio:
function getNextAudioFrame() {// ...return audioFrame;}while (true) {const audioFrame = getNextAudioFrame();const [partialTranscript, isEndpoint] = cheetah.process(audioFrame);if (isEndpoint) {finalTranscript = cheetah.flush()}}
Release resources explicitly when done with Cheetah:
cheetah.release()
Demo
For the Cheetah Node.js SDK, we offer demo applications that demonstrate how to use the Wake Word engine on real-time audio streams (i.e. microphone input) and audio files.
Setup
Install the Cheetah demo package:
npm install -g @picovoice/cheetah-node-demo
This package installs command-line utilities for the Cheetah Nodejs demos.
Usage
Use the --help
flag to see the usage options for the demo:
cheetah_demo_mic --help
Ensure you have a working microphone connected to your system and run the following command to transcribe audio live:
cheetah_demo_mic --access_key ${ACCESS_KEY}
For more information on our Cheetah demos for Nodejs, head over to our GitHub repository.