如何在node.js服务器上使用AnnYang语音重新配置
How to use AnnYang speech reconigition on the node.js server?
更新日志:
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
我有一个树莓派与节点安装。我想运行一种语音识别方法;然而,我希望网络语音api在没有打开浏览器窗口的情况下运行。
问题:所以我找到了annyang节点的节点mod版本,但似乎无法运行它?
问题:在不打开浏览器的情况下,如何从节点使用香草网络语音api或annyang,例如从node index.js
运行,这可能吗?
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');
Annyang不能在节点上运行,它需要一个浏览器,因为浏览器实现了网络语音API。
对于树莓PI上的固定命令集,最好尝试节点pocketsphinx
http://github.com/cmusphinx/node-pocketsphinx
相关文章:
- 创建一个类似链接的按钮,并通过Javascript函数打开一个新的弹出窗口
- 防止Iframe窗体在新窗口中打开
- 让文本输入幻灯片显示输入时的新文本输入?然后向后滑动
- 动态地改变“”的URL;添加新项目”;链接使用javascript/jquery
- Firebase迁移-简单的Firebase.set没有'不再工作了——旧的还是新的
- 通过js在新选项卡中有条件地打开url
- 使用jquery将mysql数据获取到新的表行中
- 触摸移动时切换到新元素
- 如何从rails中的代码中删除新行( )
- Google/html5语音识别JavaScript SDK Chrome网络工具包SpeechRecognition
- 拆分文本以每隔n个字符添加一行新行,并注意空格
- 如何在node.js服务器上使用AnnYang语音重新配置
- 使用 vuejs 新的 vuex 存储得到意外的配置错误
- 在Meanjs中,添加了新的库.Json不会自动添加到配置文件中
- [JHipster新模块][错误]需要.yo-rc.JHipster生成的配置文件
- Meteor.js,Mongo:可以向用户插入新的文档或参数.来自客户端的配置文件
- 尝试配置一个新的webpack+angular2项目,我'm获取错误TS2384:重载签名必须全部为环境签名或非
- 从JS配置对象中提取数据以创建新对象
- 如何让Cortana使用我新的或更新的语音命令定义文件?
- 如何配置SystemJS以获得加载到Jasmine测试套件中的模块的新实例