unity-game-engineibm-watsonspeech-to-textkeep-alive

Watson speech-to-text getting disconnected immediately on Unity


I am using the latest unity SDK 2.12.0 and Unity 2017.4. My unity project is available here: https://github.com/jignesh015/Watson_trial

Please note that you will need an IBM Apikey to access the API functionality.

I followed the following video tutorial for setting up the SDK: https://www.youtube.com/watch?v=_K62R9Jnxag

While running the ExampleStreaming sample as shown in the video, I'm getting the following log:

[SpeechToText.SendStart()][DEBUG] SendStart() with the following params: {"action":"start","content-type":"audio/l16;rate=22050;channels=1;","inactivity_timeout":-1,"interim_results":true,"max_alternatives":0,"profanity_filter":false,"smart_formatting":true,"speaker_labels":false,"timestamps":true,"word_confidence":true

[SpeechToText.OnListenClosed()][DEBUG] OnListenClosed(), State = DISCONNECTED

[SpeechToText.KeepAlive()][DEBUG] KeepAlive exited.

I have thoroughly searched for this issue. Seems like many people have faced a similar issue, but none of the posts have a satisfactory solution. Can anyone help me with this?


Solution

  • This has to do with the move to TLS 1.2. Only Unity 2018.2 and above support TLS 1.2 using .NET 4.x equivalent Scripting Runtime Version. https://github.com/watson-developer-cloud/unity-sdk#streaming-outside-of-us-south-region

    Since you are using Unity 2017.4 you will need to create your Speech to Text instance in US South (Dallas). This is the only region that still supports TLS 1.0.

    Alternatively, you can update to Unity 2018.2 or above and switch to Scripting Runtime Version .NET 4.x equivalent.