unity3d - 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 已退出。
我已经彻底搜索了这个问题。似乎很多人都面临过类似的问题,但没有一个帖子有令人满意的解决方案。谁能帮我这个?
解决方案
这与迁移到 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 等效版本。
推荐阅读
- php - 在事先不知道确切步数的情况下使用 Symfony 进度条
- forms - 如何设置实体、表格和 TWIG 关于带小数的数字
- react-native - 在调试中工作,但在发布中不工作 | 世博会 | react-native-unimodules
- php - 带有 Wordpress 的 XAMPP 运行速度太慢
- outlook - 当在 VSTO 加载项中调用 MailItem 的 SaveChanges 时,SelectionChanged 会在 Outlook 中触发
- firebase - 如何在组和区域中部署单个 Firebase Cloud Function?
- javascript - 单击鼠标悬停以应用样式
- python - 在 Python 中预测差分进化的并行性能
- elixir - 是否可以使用 Ecto.Migrator 模拟“ecto.load”任务来发布 Elixir?
- c# - 如何使用 C# 表单应用程序使雷达设计看起来更有创意?