npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

voice-engine

v1.0.0

Published

This is a compact module which provides services for keyword spotting, speech recognition and text to speech.

Readme

Smart Home Assistant - Voice Engine

This is a component of the Smart Home Assistant project. The voice-engine is responsible for keyword spotting locally with the help of Kitt.ai snowboy and uses IBM Watson Speech to Text and Text to Speech to interact naturally with the user.

It is in this form usable as a library only.

Usage

var VoiceEngine = require('voice-engine');

var sttengine = {
    url: "https://stream.watsonplatform.net/speech-to-text/api",
    username: "",
    password: ""
}
var ttsengine = {
  url:"https://stream.watsonplatform.net/text-to-speech/api",
  username:"",
  password:""
}
var speech = {
model: "hey_emma.pmdl",
sensitivity: 0.4
}
var engine = new VoiceEngine(sttengine, ttsengine, speech);

engine.startKeywordSpotting();
engine.startSttRecognition();
engine.synthesizeText(text);

engine.on('keyword', function() {


})
engine.on('recognition-stopped', function() {

})

engine.on('recognition', function(message) {

})
engine.on('synthesized', function(message) {

})

Requirements

In order to run the voice engine successfully you will need to install some components.

First you need a couple of them for the snowboy toolkit

sudo apt-get install libatlas-base-dev swig3.0 python-pyaudio python3-pyaudio sox -y

Second you'll need one dependency for the node-speaker module

sudo apt-get install libasound2-dev -y

Third I recommend installing the flac module to lower the cost of STT recognition

sudo apt-get install flac -y

If you are running this on a raspberry pi you also have to change the _snowboydetect library. You can get different prebuild binaries from here: https://github.com/Kitt-AI/snowboy

Also you need to configure the alsa sound system accordingly:

#asym fun start here. we define one pcm device called "pluged"
pcm.pluged {
    type plug
    #this is your output device
    slave.pcm "hw:0,1"
}

#one called "dsnooped" for capturing
pcm.dsnooped {
    ipc_key 1027
    type dsnoop
    #this is your input device
    slave.pcm "hw:1,0"
}

#and this is the real magic
pcm.asymed {
    type asym
    playback.pcm "pluged"
    capture.pcm "dsnooped"
}

#a quick plug plugin for above device to do the converting magic
pcm.pasymed {
    type plug
    slave.pcm "asymed"
}

#a ctl device to keep xmms happy
ctl.pasymed {
    type hw
    card 0
}

#for aoss:
pcm.dsp0 {
    type plug
    slave.pcm "asymed"
}

ctl.mixer0 {
    type hw
    card 0
}

pcm.!default {
    type plug
    slave.pcm "asymed"
}

Credits

The awesome Keyword spotting including the necessary python scripts are provided by Kitt.ai. Check their Licensing before using! The above .asoundrc script is provided by Evan Cohen http://docs.smart-mirror.io/docs/configure_the_pi.html. Check out his Magic Mirror!

License

Copyright 2016 Tobias Lindener

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.