Socket
Socket
Sign inDemoInstall

hotword

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hotword

Hot Word Detection and EASY to build and use


Version published
Maintainers
1
Install size
2.80 MB
Created

Readme

Source

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

Keywords

FAQs

Last updated on 13 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc