node.js bluemix的语音到文本的示例程序给出403错误

时间:2015-11-30 05:02:09

标签: javascript node.js ibm-cloud speech-to-text

我正在尝试使用示例node.js程序将bluemix的语音转换成文本。我在api凭证的用户名和密码中添加了但是当我在node.js上运行程序时,我得到了一个{ {1}}。有谁知道可能导致此错误的原因?

以下是示例代码

Error: Server responded with a non-101 status:403

由于

*未附加样本代码的道歉

1 个答案:

答案 0 :(得分:2)

服务网址错误。

而不是:

https://stream.watsonplatform.net/speech-to-text-beta/api

使用:

https://stream.watsonplatform.net/speech-to-text/api

或将其遗漏。例如:

var speech_to_text = watson.speech_to_text({
  username: '{username}',
  password: '{password}',
  version: 'v1'
});