I'm currently using Watsons powerful speech to text API, which returns a JSON(?) on microphone input.
This is part of the code which returns the JSON File:
service.recognizeUsingWebSocket(audio, options, new BaseRecognizeCallback() {
@Override
public void onTranscription(SpeechResults speechResults) {
System.out.println(speechResults);
}
});
What I'm currently trying to do, is to get the "transcript" part of the speechResults json (see output), but it doesn't seem to work with the typical json description using a json parser, since the speechResults is not a String.
Do you guys have any ideas how to realize this?
This is the output:
{
"result_index": 0,
"results": [
{
"final": true,
"alternatives": [
{
"confidence": 0.908,
"timestamps": [
[
"are",
0.03,
0.2
],
[
"you",
0.2,
0.36
]
],
"transcript": "are you ",
"word_confidence": [
[
"are",
0.838
],
[
"you",
0.982
]
]
}
]
}
]
}