Offline voice recognition for “alya-smart-mirror”

Bilal Al-Saeedi
2 min readMar 12, 2018

--

Almost a week is left for eclipse open IoT challenge 4.0 to finish, and we want to introduce the offline voice recognition capabilities of alya-smart-mirror(ASM). Having a voice recognition support in ASM is part of the core services which is used to recognize the voice commands given by the user. We selected an offline voice recognition service since it is less expensive and requires less configurations.

Architecture

We have used the open-source project pocketspinx as our speech recognition engine which uses the Matrix creator microphone array for best results. The commands can be enhanced by adding them to a text file and restarting the service. Below is an overview how everything works.

How it works

Configuring the voice commands

  1. Add commands to assets/commands.txt, something like this:
alya stop
alya start
alya next
alya previous

2. Generate assets :

npm install -g https://github.com/matrix-io/lmtool-cli.git
lmtool assets/commands.txt
tar xf <generated_file>.tgz -C assets

3. Change the corresponding names inside config.defaults.json :

{
"lmFileName": "1161.lm",
"dicFileName": "1161.dic"
}

Running the service

  1. Clone project:
git clone https://github.com/alronz/alya-smart-mirror.git

2. Install packages

  • first general dependencies:
npm install
  • then this project dependencies:
cd voice-recognition/matrix-pocketsphinx
npm install

3. Start:

node index.js

say some voice commands like alya hi

--

--