npm.io
0.1.5 • Published 13h ago

@voxrt/wake-word

Licence
Apache-2.0
Version
0.1.5
Deps
0
Size
490 kB
Vulns
0
Weekly
0
Stars
6

@voxrt/wake-word — Node.js binding for the VoxRT wake-word SDK

On-device wake-word detection on Linux aarch64. Same Rust runtime shipping on Android, iOS, and via the C / Python / Go / Rust channels of the voxrt-wake-word-linux release.

Version: 0.1.5 Platform: linux-arm64-gnu (glibc 2.17+ baseline — Raspberry Pi 3 / 4 / 5 / Zero 2, Jetson L4T, Ubuntu 18.04+, RHEL 7+, AWS Graviton). Node: ≥ 18.

Install

npm install @voxrt/wake-word

Quickstart

const fs = require("fs");
const { WakeWordEngine } = require("@voxrt/wake-word");

const engine = WakeWordEngine.fromPath("voxrt_wake_word.vxrt");
engine.threshold = 0.9;
engine.cooldownFrames = 100;

// Feed 16 kHz mono int16 chunks from your audio source —
// MediaStream / Web Audio / ALSA bridge / file stream.
for (const chunk of micChunks) {
  for (const d of engine.pushPcmI16(chunk)) {
    console.log(`wake! t=${d.timestampSec.toFixed(3)}s score=${d.score.toFixed(4)}`);
  }
}

TypeScript

Types ship with the package:

import { WakeWordEngine, Detection } from "@voxrt/wake-word";

WakeWordEngine.fromPath(string): WakeWordEngine WakeWordEngine.fromBytes(Buffer): WakeWordEngine engine.pushPcmI16(Int16Array): Detection[] engine.pushPcmF32(Float32Array): Detection[] engine.threshold: number (range [0, 1], default 0.9) engine.cooldownFrames: number (default 100, units of 10 ms frames) engine.currentScore(): number engine.reset(): void

Detection.frameIndex: bigint Detection.timestampSec: number Detection.score: number

License

  • Wrapper sources (this package, index.js, index.d.ts, README.md): Apache-2.0.
  • Bundled native addon (voxrt-wake-word.linux-arm64-gnu.node): proprietary — see LICENSE-BINARY.

Keywords