首页 > 解决方案 > Watson 语音转文本在 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() 带有以下参数:{"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(),状态 = DISCONNECTED

[SpeechToText.KeepAlive()][DEBUG] KeepAlive 已退出。

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

标签: unity3dibm-watsonspeech-to-textkeep-alivedisconnected

解决方案


这与迁移到 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 或更高版本并切换到 Scripting Runtime Version .NET 4.x 等效版本。


推荐阅读