Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

RedKenrok/Electron-VoiceInterfaceBoilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Electron-VoiceInterfaceBoilerplate

Installation

Download a compressed copy of the project, or run the following command and open up the folder if you have Git installed.

git clone https://github.com/RedKenrok/Electron-VoiceInterfaceBoilerplate.git && cd Electron-VoiceInterfaceBoilerplate

Make sure Node.js is installed, this installation will also include Npm.js. Run the following command install the project dependencies.

npm install --save

Audio recording

For audio recording the module 'node-audiorecorder' is used. This requires the usage of the 'rec' or on windows 'sox' command, please make sure this is installed and working. See the previously linked repository for more information.

Keys

In order to use the speech recognition and natural language processing an online API will be need to be configured so add either a Google Cloud Platform key or Wit.ai key to the data folder. See the two section below for more information.

Google Cloud Platform

Get the key file from the Google Cloud Platform as a json file. Rename this file to 'google-cloud.json' and add it to the 'app/keys/' directory.

For more information see step 1 through 3 of the quickstart guide of the Speech API and Language API.

Wit.ai

Get the Access tokens from the Wit.ai site and add them to a file named 'wit-ai.json' in the 'app/keys/' directory.

{
  "app_id": "App ID",
  "server": "Server Access Token",
  "client": "Client Access Token"
}

Hotword detection

If you want to use snowboy's hotword detection and are running MacOS or a compatible Linux distro then add a file named 'hotworddetector.json' to the 'app/data/' directory and add the following information.

{
  "detector": {
    "resource": "./node_modules/snowboy/resources/common.res"
  },
  "models": [
    {
      "file": "./node_modules/snowboy/resources/snowboy.umdl",
      "hotwords": "snowboy"
    }
  ],
  "recorder": {}
}

Replace the given data with your own and add any other to configure it.

Troubleshooting

Post install

If you are on windows and have errors during the post install phase when rebuilding the dependencies or get an error related to gyp or grpc try the following commands in a terminal with administrator privileges.

  1. Install python 2.7

npm i -g -production windows-build-tools

  1. Install node-gyp

npm i -g node-gyp

  1. Set the environmental path for python.

setx PYTHON "%USERPROFILE%.windows-build-tools\python27\python.exe"

  1. Restart the device for the environmental path to take effect.
  2. Remove the node_modules directory of the project.
  3. Reinstall the dependencies.

npm i --save