Voice Recognition Module for MagicMirror2
This voice recognition works offline. To protect your privacy, no one will record what's going on in your room all day long. So keep in mind that there is no huge server farm, that handles your voice commands. The raspberry is just a small device and this is a cpu intensive task. Also the dictionairy has only the words specified by the modules, so there is a chance for false positives.
If you can live with latency, bugged detections and want to have data privacy, feel free to use this module.
- An installation of MagicMirror2
- Packages: bison libasound2-dev autoconf automake libtool python-dev swig python-pip
- SphinxBase
- PocketSphinx
- A microphone
- npm
- PocketSphinx-continuous
- lmtool
-
Clone this repo into
~/MagicMirror/modules
directory. -
Run command
bash dependencies.sh
in~/MagicMirror/modules/MMM-voice/installers
directory, to install all dependencies. This will need a couple of minutes. -
Configure your
~/MagicMirror/config/config.js
:{ module: 'MMM-voice', position: 'bottom_bar', config: { microphone: 1, ... } }
Option | Default | Description |
---|---|---|
microphone |
REQUIRED | Id of microphone shown in the installer. |
keyword |
'MAGIC MIRROR' |
Keyword the mirror starts to listen. IMPORTANT: Only UPPERCASE Letters |
timeout |
15 |
time the keyword should be active without saying something |
You need to say your KEYWORD (Default: MAGIC MIRROR), when the KEYWORD is recognized the microphone will start to flash and as long as the microphone is flashing (timeout config option) the mirror will recognize COMMANDS or MODES (Keep in mind that the recognition will take a while, so when you say your COMMAND right before the microphone stops flashing the COMMAND will propably not recognized).
Mode of this module: VOICE
COMMANDS:
- HIDE MODULES
- SHOW MODULES
- WAKE UP
- GO TO SLEEP
- OPEN HELP
- CLOSE HELP
To select a MODE, the specfic MODE has to be the first word of a COMMAND or right after the KEYWORD, when the microphone stopped flashing.
List of all supported modules in the Wiki.
npm run lint
- Lints JS and CSS files.npm run docs
- Generates documentation.
The documentation can be found here
If you want to support your own module, check out the Guide and add it to the Wiki.