unity-sdk icon indicating copy to clipboard operation
unity-sdk copied to clipboard

Cannot find SpechResultList library

Open doanhtai00 opened this issue 9 years ago • 5 comments

Hi. I cannot find SpeechResultList import on file for function SpeechToText. Please help me. Thanks.

doanhtai00 avatar Jan 17 '17 08:01 doanhtai00

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));
            }
        }
    }
}

Miojo avatar Jan 30 '17 18:01 Miojo

@doanhtai00 Were you able to resolve the issue?

mediumTaj avatar Feb 03 '17 15:02 mediumTaj

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

Joshua-Carr avatar Feb 13 '17 01:02 Joshua-Carr

Thanks, tracking here

https://github.com/watson-developer-cloud/unity-sdk/issues/216

mediumTaj avatar Feb 13 '17 01:02 mediumTaj

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; } }

daphna-kaplan avatar Jul 07 '17 13:07 daphna-kaplan