1

UPDATED LOG:

ws@0.5.0 install /Users/matthew.harwood/workspace/akqa/insights/tts/node-pocketsphinx/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished

> ws@0.4.31 install /Users/matthew.harwood/workspace/akqa/insights/tts/node-pocketsphinx/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished

> pocketsphinx@1.0.1 install /Users/matthew.harwood/workspace/akqa/insights/tts/node-pocketsphinx
> node-gyp rebuild

Package pocketsphinx was not found in the pkg-config search path.
Perhaps you should add the directory containing `pocketsphinx.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pocketsphinx' found
Package sphinxbase was not found in the pkg-config search path.
Perhaps you should add the directory containing `sphinxbase.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sphinxbase' found
gyp: Call to 'pkg-config --cflags pocketsphinx sphinxbase' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 13.2.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/matthew.harwood/workspace/akqa/insights/tts/node-pocketsphinx
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 

npm ERR! Darwin 13.2.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.35
npm ERR! npm  v2.1.18
npm ERR! code ELIFECYCLE
npm ERR! pocketsphinx@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pocketsphinx@1.0.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pocketsphinx package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pocketsphinx
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/matthew.harwood/workspace/akqa/insights/tts/node-pocketsphinx/npm-debug.log

I have a raspberry pi with node install. I want a method of speech recognition to run; however I would like theweb speech api to run without an open browser window.

Problem: So I found a node mod version of annyang-node But cannot seem to get it to run?

Question: How would I go about using the vanilla web speech api or annyang from node without opening a browser,e.g. running from node index.js is this at all possible?

index.js

var Annyang = require('annyang');
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');

var annyang = new Annyang();

// Let's define a command. 
var commands = {
    'show tps report': function() { 
        // do something  
    }
};

// Initialize our commands with annyang 
annyang.init(commands);

// Trigger a command 
annyang.trigger('show tps report');
Armeen Moon
  • 18,061
  • 35
  • 120
  • 233

1 Answers1

1

Annyang can not run on node, it requires a browser because browser implements web speech API.

For fixed set of commands on raspberry PI it's better to try node-pocketsphinx

http://github.com/cmusphinx/node-pocketsphinx

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • Error: Cannot find module './build/Release/PocketSphinx.node' any ideas? – Armeen Moon Mar 25 '15 at 22:59
  • 1
    There is no need to hurry, please provide more information about what exactly lead to the error you see and I'm sure it would be easy to fix. – Nikolay Shmyrev Mar 25 '15 at 23:01
  • 1
    Thanks for the nice video with your color fonts. For the future, software developers prefer text logs and not screenshots or videos. And never try to insert video or screenshot in docx file and share that. Logs are way more helpful because you can read them, instead of trying to extract frame by frame from video. In your log you could see the error "Npm install failed with “cannot run in wd” which is covered in the following answer http://stackoverflow.com/questions/18136746/npm-install-failed-with-cannot-run-in-wd – Nikolay Shmyrev Mar 25 '15 at 23:48
  • You need to install sphinxbase and pocketsphinx first. You also need to set pkg-config path to point to /usr/local/lib/pkg-config. See http://wolfpaulus.com/jounal/embedded/raspberrypi2-sr/ – Nikolay Shmyrev Mar 27 '15 at 07:34
  • Awesome! you should put this into your README.md on github. Looking forward to using your repo! Thanks! – Armeen Moon Mar 27 '15 at 19:02