building blocks to create voice interface applications
Clone or download
Failed to load latest commit information.
examples fix import error Jul 25, 2018
tests add a test Aug 30, 2017
voice_engine add file sink running on separate thread Aug 17, 2018
.gitignore initial Aug 23, 2017
.travis.yml adjust for ci Aug 30, 2017
LICENSE add license May 2, 2018 initial Aug 23, 2017 0.0.5 Apr 25, 2018
setup.cfg initial Aug 23, 2017 0.1.3 Jul 25, 2018

Voice Engine

Build Status

The library is used to create voice interface applications. It includes building blocks such as KWS (keyword spotting), DOA (Direction Of Arrival). There are also elements to measure RMS (dBFS or dB(A)).


  • pyaudio
  • numpy
  • snowboy


Install pyaudio, numpy and snowboy, use virtualenv a virtual python environment.

sudo apt install python-pyaudio python-numpy python-virtualenv
sudo apt-get install swig python-dev libatlas-base-dev build-essential make
git clone --depth 1
cd snowboy
virtualenv --system-site-packages env
source env/bin/activate
python build
python bdist_wheel
pip install dist/snowboy*.whl
cd ..
git clone
cd voice-engine
python bdist_wheel
pip install dist/*.whl

Get started

To record audio and search keyword "snowboy", see also

import time
from voice_engine.kws import KWS
from voice_engine.source import Source

src = Source()
kws = KWS()

def on_detected(keyword):
    print('found {}'.format(keyword))
kws.on_detected = on_detected

while True:
    except KeyboardInterrupt:

Building blocks

The library uses gstreamer-like elements which can be linked together as an audio pipeline. One element can connect to more than one other elements.

The topology can be:

Source --> ChannelPicker --> KWS          Source --> ChannelPicker --> KWS --> Alexa
  |                          /\
  V                        /   \
 DOA                   Alexa   Google Asissitant