Watson 语音转文本在 Unity 上立即断开连接

Watson speech-to-text getting disconnected immediately on Unity

我正在使用最新的 unity SDK 2.12.0 和 Unity 2017.4。 我的统一项目在这里可用: https://github.com/jignesh015/Watson_trial

请注意,您需要 IBM Apikey 才能访问 API 功能。

我按照以下视频教程设置了 SDK: https://www.youtube.com/watch?v=_K62R9Jnxag

当 运行 视频中显示的 ExampleStreaming 示例时,我收到以下日志:

[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.

这个问题我已经彻底搜索过了。似乎很多人都遇到过类似的问题,但是 none 的帖子有令人满意的解决方案。谁能帮我解决这个问题?

这与迁移到 TLS 1.2 有关。只有 Unity 2018.2 及更高版本支持使用 .NET 4.x 等效脚本运行时版本的 TLS 1.2。 https://github.com/watson-developer-cloud/unity-sdk#streaming-outside-of-us-south-region

由于您使用的是 Unity 2017.4,因此您需要在美国南部(达拉斯)创建 Speech to Text 实例。这是唯一仍然支持 TLS 1.0 的区域。

或者,您可以更新到 Unity 2018.2 或更高版本并切换到等效的脚本运行时版本 .NET 4.x。