/okpi

Virtual assistant with offline voice recognition for Raspberry Pi

Primary LanguageTypeScriptMozilla Public License 2.0MPL-2.0

OkPi

Virtual assistant with offline voice recognition. Despite being primarily designed for Raspberry Pi, it should compile on any computer running Linux or macOS.

Installation

Pocket Sphinx

  • The PocketSphinx installation currently requires Node.js 6
    • This can be achieved by using a version manager such as nvm:
      • nvm install 6
  • Install the PocketSphinx dependencies:
    • apt-get install cmake pkg-config libpcre3-dev bison
    • swig from GitHub
    • sphinxbase from GitHub
    • pocketsphinx from GitHub
    • Note that certain tweaks might be required prior to install:
      • export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
      • ln -s /usr/bin/swig3.0 /usr/bin/swig (Create a symlink for swig3.0)
    • npm install cmake-js -g

Say.js

  • Install Festival with a default voice:
    • apt-get install festival festvox-rablpc16k

NPM Dependencies

  • npm install

Launching

  • Make sure that this repository (OkPi) is in the same folder as the cloned pocketsphinx repository
  • npm run start
    • Or alternatively using watch mode:
    • npm run watch
    • npm run launch (in a separate terminal)

Architecture

  • The application roughly implements the following structure:

  • Speech input

    • -> AudioInput
    • -> SpeechRecognitionEngine
    • -> UtteranceProcessor
    • -> Skill
    • -> OutputFacade