使用voiceBase Api进行Nexmo webSocket语音转文本

时间:2018-02-12 06:42:14

标签: nexmo

我正在尝试使用nexmo中的语音库将语音转换为文本。我在WebSocket客户端遇到了这个问题。 我的回复错误是:

info: Server listening on:8900
info: A client is connected!
events.js:183
throw  er; // Unhandled 'error' event
Error: This socket is closed
at Socket._writeGeneric (net.js:726:18)
at Socket._write (net.js:786:8)
at doWrite (_stream_writable.js:387:12)
at writeOrBuffer (_stream_writable.js:373:5)
at Socket.Writable.write (_stream_writable.js:290:11)
at Socket.write (net.js:704:40)
at WebSocketRequest.accept (/home/apptivo/Music/nexmoVoicebaseSample/Nexmo-RTS-Voicebase-master/WS-node/node_modules/websocket/lib/WebSocketRequest.js:450:21)
at WebSocketServer.handleUpgrade (/home/apptivo/Music/nexmoVoicebaseSample/Nexmo-RTS-Voicebase-master/WS-node/node_modules/websocket/lib/WebSocketServer.js:216:19)
at emitThree (events.js:141:20)
at Server.emit (events.js:217:7)

如何解决这个问题???

1 个答案:

答案 0 :(得分:-1)

我之前遇到过这个问题(我是这个项目的开发者)。确保您的api密钥正确并且在WS-Node文件夹内的.env文件中设置。它应该设置为

ASR_URL={VOICEBASE_URL}
ASR_CLIENT_KEY={VOICEBASE_CLIENT_KEY}
ASR_CLIENT_SECRET={VOICEBASE_CLIENT_SECRET}