1.0.9 • Published 4 years ago

hotword v1.0.9

Weekly downloads
36
License
ISC
Repository
-
Last release
4 years ago

Hotword

Description

This is the project Porcupine (https://github.com/Picovoice/Porcupine)'s Node.js wrapper.

It's easy to use, and fit almost every platform because it run on WASM.

Usage

Following is the example (it is test.js in the package):

let fs=require("fs");
let wavdecoder=require("wav-decoder");
let pico=require(__dirname+"/pico.js");

wavdecoder.decode(fs.readFileSync("multiple_keywords.wav")).then((wav)=>{
		let piko=new pico({
			grapefruit:fs.readFileSync(__dirname+"/prekeywords/grapefruit_wasm.ppn"),
			bumblebee:fs.readFileSync(__dirname+"/prekeywords/bumblebee_wasm.ppn")
		},wav.sampleRate,(word)=>{
			console.log(word);
		})

		piko.init().then(()=>{
				
				for(let i=0;i<wav.channelData[0].length;i+=1024)
				piko.feed(wav.channelData[0].slice(i,i+1024));
			
		});

});

Just decode the wav and feed it to the 'pico' instance,
the we can get the keyword on callback function.

Additionally, if you want a live hot word detection,just start a
recorder then feed the 'pico' with audio frame data.

Run a test

npm run test

if success, you gonna get this

bumblebee
grapefruit

Get a keyword file

see

https://github.com/Picovoice/Porcupine/tree/master/tools/optimizer

Contacts

Wyatt Zheng (Yango University)
yuxon@qq.com

1.0.9

4 years ago

1.0.8

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago