Skip to content

Commit

Permalink
Merge branch 'dev' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
evancohen authored Jan 9, 2019
2 parents bb6c3e9 + 5a5fec1 commit 83cb06d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ brew install sox
Configure out cloud speech recognition system of choice, like [Google Cloud
Speech API](https://cloud.google.com/speech/docs/getting-started).

__Note:__ You need to use the `GOOGLE_APPLICATION_CREDENTIALS` environment variable for your JSON keyfile.

Add sonus and said recognizer:
``` javascript
const Sonus = require('sonus')
const speech = require('@google-cloud/speech')({
projectId: 'streaming-speech-sample',
keyFilename: './keyfile.json'
})
const speech = require('@google-cloud/speech')
const client = new speech.SpeechClient()
```

Add your keyword and initialize Sonus with a [Snowboy](https://snowboy.kitt.ai)
hotword:
``` javascript
const hotwords = [{ file: 'resources/snowboy.umdl', hotword: 'snowboy' }]
const sonus = Sonus.init({ hotwords }, speech)
const sonus = Sonus.init({ hotwords }, client)
```

Create your own Alexa in less than a tweet:
Expand Down
7 changes: 4 additions & 3 deletions examples/annyang-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

const ROOT_DIR = __dirname + '/../'
const Sonus = require(ROOT_DIR + 'index.js')
const speech = require('@google-cloud/speech')({
const speech = require('@google-cloud/speech')
const client = new speech.SpeechClient({
projectId: 'streaming-speech-sample',
keyFilename: ROOT_DIR + 'keyfile.json'
keyFilename: ROOT_DIR + 'keyfile.json'
})

const hotwords = [{ file: ROOT_DIR + 'resources/sonus.pmdl', hotword: 'sonus' }]
const language = "en-US"
const sonus = Sonus.init({ hotwords, language: language }, speech)
const sonus = Sonus.init({ hotwords, language: language }, client)

const commands = {
'hello': function () {
Expand Down
9 changes: 5 additions & 4 deletions examples/example.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
'use strict'

const ROOT_DIR = __dirname + '/../'
const Sonus = require(ROOT_DIR + 'index.js')
const speech = require('@google-cloud/speech')({
const Sonus = require(ROOT_DIR + 'index.js') //require('sonus')
const speech = require('@google-cloud/speech')
const client = new speech.SpeechClient({
projectId: 'streaming-speech-sample',
keyFilename: ROOT_DIR + 'keyfile.json'
keyFilename: ROOT_DIR + 'keyfile.json'
})

const hotwords = [{ file: ROOT_DIR + 'resources/sonus.pmdl', hotword: 'sonus' }]
const language = "en-US"

//recordProgram can also be 'arecord' which works much better on the Pi and low power devices
const sonus = Sonus.init({ hotwords, language: language, recordProgram: "rec" }, speech)
const sonus = Sonus.init({ hotwords, language: language, recordProgram: "rec" }, client)

Sonus.start(sonus)
console.log('Say "' + hotwords[0].hotword + '"...')
Expand Down
7 changes: 4 additions & 3 deletions examples/trigger-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

const ROOT_DIR = __dirname + '/../'
const Sonus = require(ROOT_DIR + 'index.js')
const speech = require('@google-cloud/speech')({
const speech = require('@google-cloud/speech')
const client = new speech.SpeechClient({
projectId: 'streaming-speech-sample',
keyFilename: ROOT_DIR + 'keyfile.json'
keyFilename: ROOT_DIR + 'keyfile.json'
})

const hotwords = [{ file: ROOT_DIR + 'resources/sonus.pmdl', hotword: 'sonus' }]
const language = "en-US"
const sonus = Sonus.init({ hotwords, language: language }, speech)
const sonus = Sonus.init({ hotwords, language: language }, client)

try{
Sonus.trigger(sonus, 1)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sonus",
"version": "0.1.9",
"version": "0.2.0-rc1",
"description": "Open source cross platform decentralized always-on speech recognition framework",
"main": "index.js",
"scripts": {
Expand All @@ -26,8 +26,8 @@
},
"homepage": "https://github.com/evancohen/sonus#readme",
"dependencies": {
"@google-cloud/speech": "^0.10.3",
"node-record-lpcm16": "^0.3.0",
"@google-cloud/speech": "^2.1.1",
"node-record-lpcm16": "^0.3.1",
"snowboy": "^1.2.0"
},
"devDependencies": {
Expand Down

0 comments on commit 83cb06d

Please sign in to comment.