【发布时间】:2020-12-16 15:09:12
【问题描述】:
我想要使用 Google Cloud Speech to text 实时流式传输
我在 Google Cloud 语音转文本文档中运行一些示例代码
但是会出现这个错误
sox has exited with error code 1.
Enable debugging with the environment variable DEBUG=record.
我尝试过的事情
-
安装 sox (14.4-1, 14-4-2) 后设置 Sox 环境变量 => 不起作用
-
在记录选项中更改
recordProgram值(recordProgram: 'rec' => 'sox')但它不起作用。 -
我找到了一个解决方案,可以在
node_modules/node-record-lpcm16/index.js中将-t、raw添加到cmdArgs,但我无法应用它,因为现在代码不同了。 -
使用节点麦克风库但未被识别
操作系统:window10
language: node js
dependencies: {
"@google-cloud/speech": "^4.1.5",
"express": "^4.17.1",
"node-microphone": "^0.1.5",
"node-record-lpcm16": "^1.0.1"
}
代码沙盒:simple source code
【问题讨论】:
-
您是否这样做:“使用环境变量 DEBUG=record. 启用调试”?结果如何?
-
重启电脑就可以了 谢谢你的回答:)
标签: javascript node.js sox