Offline voice recognition for “alya-smart-mirror”
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.
Configuring the voice commands
- 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
- 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
More readings
- “alya” a DIY modular personalized open-source smart mirror
- “asm-youtube-addon” a react component for getting youtube videos using voice commands
- “asm-backend” the backend for alya smart mirror
- Offline face recognition for “alya-smart-mirror”
- Cloud-based Face Recognition for Alya Smart Mirror
- https://github.com/alya-mirror/alya-smart-mirror/tree/dev/voice-recognition/matrix-pocketsphinx