我正在使用 Google Speech API 的 Node.JS 变体。
speech_context
在我敢于传入一个字符串参数数组之前,一切都很好而且很花哨。当我尝试以下每种方式时,流会中断,但不会发出错误。因此,我无法诊断。
我正在传递一系列字符串["one", "two", "three"]
,遵守文档,所以我相信。我的原始配置如下所示:
const cf = {
config: {
encoding: 'LINEAR16',
sampleRate: 48000
}
}
我试过cf.config.speech_context = ARRAY
, cf.config.speech_context.phrases = ARRAY
,cf.speech_context = ARRAY
和cf.speech_context.phrases = ARRAY
.
同样,我没有收到错误消息,也没有得到结果。我什么都得不到。原来的配置靠自己的作品。
这有一个基本的流:
recognizeStream = speech.createRecognizeStream(cf)
.on('error', console.error)
.on('data', console.log)
想法?任何帮助将不胜感激!