我正在尝试构建一个应用程序,该应用程序采用流式音频输入(例如:麦克风中的线路)并使用 IBM Bluemix (Watson) 进行语音转文本。
我简单修改了找到的示例Java代码here。这个例子发送的是 WAV,但我发送的是 FLAC...这[应该]是无关紧要的。
结果很糟糕,非常糟糕。这是我使用 Java Websockets 代码时得到的结果:
{
"result_index": 0,
"results": [
{
"final": true,
"alternatives": [
{
"transcript": "it was six weeks ago today the terror ",
"confidence": 0.92
}
]
}
]
}
现在,将上面的结果与下面的结果进行比较。以下是发送相同内容但使用 cURL (HTTP POST) 时的结果:
{
"results": [
{
"alternatives": [
{
"confidence": 0.945,
"transcript": "it was six weeks ago today the terrorists attacked the U. S. consulate in Benghazi Libya now we've obtained email alerts that were put out by the state department as the attack unfolded as you know four Americans were killed including ambassador Christopher Stevens "
}
],
"final": true
},
{
"alternatives": [
{
"confidence": 0.942,
"transcript": "sharyl Attkisson has our story "
}
],
"final": true
}
],
"result_index": 0
}
这是一个几乎完美的结果。
为什么使用 Websocket 时会出现差异?