Closed doanhtai00 closed 7 years ago
change it to SpeechRecognitionEvent instead. If you are trying to make the speech to texto tutorial work, also change the variables to lower case:
void HandleOnRecognize(SpeechRecognitionEvent result)
{
if (result != null && result.results.Length > 0)
{
foreach (var res in result.results)
{
foreach (var alt in res.alternatives)
{
string text = alt.transcript;
Debug.Log(string.Format("{0} ({1}, {2:0.00})\n", text, res.final ? "Final" : "Interim", alt.confidence));
}
}
}
}
@doanhtai00 Were you able to resolve the issue?
The above fix resolved the same problems I was facing.
For others: the examples/scripts/ folders show the SpeechRecognitionEvent and not SpeechResultList as found in the readme
Thanks, tracking here
https://github.com/watson-developer-cloud/unity-sdk/issues/216
hey I am having similar issue the SpeechResultList and the SpeechResult are not recognized and I dont know how to replace them the function is : protected void OnSpeechToTextResult(SpeechResultList results) { if (results.HasResult()) { SpeechResult watsonResult = results.Results[0]; var textResult = m_WatsonSpeechToTextComponent.CreateSpeechToTextResult(watsonResult); if (m_OnTextResult != null) { m_OnTextResult(textResult); } m_LastResult = textResult; } }
Hi. I cannot find SpeechResultList import on file for function SpeechToText. Please help me. Thanks.