https://github.com/joyarzun/speeech
Speech recognition with hotword offline detection for nodejs
https://github.com/joyarzun/speeech
google-speech-recognition nodejs speech-recognition wit-ai witai
Last synced: about 2 months ago
JSON representation
Speech recognition with hotword offline detection for nodejs
- Host: GitHub
- URL: https://github.com/joyarzun/speeech
- Owner: joyarzun
- License: mit
- Created: 2017-07-23T06:22:16.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-21T05:33:31.000Z (almost 9 years ago)
- Last Synced: 2025-02-26T10:03:03.651Z (over 1 year ago)
- Topics: google-speech-recognition, nodejs, speech-recognition, wit-ai, witai
- Language: JavaScript
- Size: 85 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://circleci.com/gh/joyarzun/speeech/tree/master)
# Speeech
Alexa style's speech recognition with hotword offline support detection for nodejs. Hotword recognition it's offline then you can use an online service streaming like Google Speech or Wit.ai.
**Important: This is an Work in Progress**
## Installation
```
npm install --save speeech
```
## Requirements
You need to have [SoX](http://sox.sourceforge.net) installed.
#### Debian and derivatives:
```
sudo apt-get install sox libsox-fmt-all
```
#### Arch Linux:
```
yaourt sox cblas
```
#### MacOS:
```
brew install sox
```
Once SoX it's installed you can try with:
```
rec new-file.wav
```
## Usage
Inside of examples folder you can find templates for each service.
Check out the comments for install others dependencies.
### Google Speech
```
const speeech = require("speeech");
const serviceConfig = {
auth: {
projectId: "streaming-speech-sample",
keyFilename: "./keyfile.json"
},
streaming: {
config: {
encoding: "LINEAR16",
sampleRateHertz: 16000,
languageCode: "en-US"
},
singleUtterance: true,
interimResults: true
}
};
speeech.emit("start", speeech.googleService(serviceConfig));
speeech.on("result", result => console.log("result", result));
```
You need to download a keyfile from google console.
### Wit.ai
```
const speeech = require("speeech");
const serviceConfig = require("./witkeyfile.json");
speeech.emit("start", speeech.witService(serviceConfig));
speeech.on("result", result => console.log("result", result));
```
witkeyfile.json:
```
{
"witToken": "XXXXXXXXXXXXXXXXXXX"
}
```
### Api.api
Api.ai use a webhook to comunicate with external services. Inside of example you can use `apiaiWebhook.js` as template for service.
For the speech logic you can use `googleApiAiExample.js`
accukeyfile.json looks like:
```
{
"apikey": "XXXXXXXXXXXXXXX",
"language": "es-cl"
}
```
apiAikeyfile.json:
```
{
"apiAiToken": "XXXXXXXXXXXXXXX"
}
```