【发布时间】:2020-09-10 21:14:04
【问题描述】:
我按照教程在 Unity 2019.4.9f1 中通过 IBM Watson Assistant 使用文本到语音。问题是没有将文本翻译成语音,我做了一些日志记录,看看它是否收到了来自助手的结果,它确实收到了,但它没有变成语音。我是使用 Unity 和 IBM Watson 的新手,所以我不明白问题出在哪里。我尝试在线查找错误,但找不到任何解决方案。任何帮助将不胜感激。
我的控制台中出现的 3 个错误是:
[09/10/2020 20:44:58][RESTConnector.ProcessRequestQueue()][ERROR] URL:https://api.eu-gb.text-to-speech.watson.cloud.ibm.com /v1/synthesize?voice=en-GB_KateVoice,错误代码:400,错误:HTTP/1.1 400 错误请求,响应:{ "error": "输入包含不匹配的开放 SSML 标签", “代码”:400, "code_description": "错误请求" } UnityEngine.Debug:LogError(对象) IBM.Cloud.SDK.Debug.DebugReactor:ProcessLog(LogRecord)(在 Assets/IBMSDKCore/Debug/DebugReactor.cs:60) IBM.Cloud.SDK.LogSystem:ProcessLog(LogRecord)(位于 Assets/IBMSDKCore/Logging/Logger.cs:207) IBM.Cloud.SDK.Log:Error(String, String, Object[])(在 Assets/IBMSDKCore/Logging/Logger.cs:280) IBM.Cloud.SDK.Connection.d__33:MoveNext()(位于 Assets/IBMSDKCore/Connection/RESTConnector.cs:606) IBM.Cloud.SDK.Utilities.Routine:MoveNext()(位于 Assets/IBMSDKCore/Utilities/Runnable.cs:131) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
[09/10/2020 20:44:58][Unity][CRITICAL] Unity 异常 ArgumentNullException:缓冲区不能为空。 参数名称:缓冲区:System.IO.MemoryStream..ctor (System.Byte[] buffer, System.Boolean writable) (at :0) (wrapper remoting-invoke-with-check) System.IO.MemoryStream..ctor(byte[],bool) IBM.Cloud.SDK.Utilities.WaveFile.ParseWAV(System.String clipName,System.Byte[] 数据)(位于 Assets/IBMSDKCore/Utilities/WaveFile.cs:115) TextToSpeech+c__DisplayClass18_0.b__0(IBM.Cloud.SDK.DetailedResponse`1[T] 响应,IBM.Cloud.SDK.IBMError 错误)(在 Assets/Script/TextToSpeech.cs:218) IBM.Watson.TextToSpeech.V1.TextToSpeechService.OnSynthesizeResponse(IBM.Cloud.SDK.Connection.RESTConnector+Request req,IBM.Cloud.SDK.Connection.RESTConnector+Response resp)(在 Assets/Watson/Scripts/Services/TextToSpeech/ V1/TextToSpeechService.cs:357) IBM.Cloud.SDK.Connection.RESTConnector+d__33.MoveNext ()(位于 Assets/IBMSDKCore/Connection/RESTConnector.cs:646) IBM.Cloud.SDK.Utilities.Runnable+Routine.MoveNext ()(位于 Assets/IBMSDKCore/Utilities/Runnable.cs:131) UnityEngine.SetupCoroutine.InvokeMoveNext(System.Collections.IEnumerator 枚举器,System.IntPtr returnValueAddress)(在:0) UnityEngine.Debug:LogError(对象) IBM.Cloud.SDK.Debug.DebugReactor:ProcessLog(LogRecord)(在 Assets/IBMSDKCore/Debug/DebugReactor.cs:60) IBM.Cloud.SDK.LogSystem:ProcessLog(LogRecord)(位于 Assets/IBMSDKCore/Logging/Logger.cs:207) IBM.Cloud.SDK.Log:Critical(String, String, Object[])(在 Assets/IBMSDKCore/Logging/Logger.cs:295) IBM.Cloud.SDK.LogSystem:UnityLogCallback(String, String, LogType)(在 Assets/IBMSDKCore/Logging/Logger.cs:168) UnityEngine.Application:CallLogCallback(String, String, LogType, Boolean)
ArgumentNullException:缓冲区不能为空。 参数名称:缓冲区 System.IO.MemoryStream..ctor(System.Byte[] 缓冲区,System.Boolean 可写)(在:0) (wrapper remoting-invoke-with-check) System.IO.MemoryStream..ctor(byte[],bool) IBM.Cloud.SDK.Utilities.WaveFile.ParseWAV(System.String clipName,System.Byte[] 数据)(位于 Assets/IBMSDKCore/Utilities/WaveFile.cs:115) TextToSpeech+c__DisplayClass18_0.b__0(IBM.Cloud.SDK.DetailedResponse`1[T] 响应,IBM.Cloud.SDK.IBMError 错误)(在 Assets/Script/TextToSpeech.cs:218) IBM.Watson.TextToSpeech.V1.TextToSpeechService.OnSynthesizeResponse(IBM.Cloud.SDK.Connection.RESTConnector+Request req,IBM.Cloud.SDK.Connection.RESTConnector+Response resp)(在 Assets/Watson/Scripts/Services/TextToSpeech/ V1/TextToSpeechService.cs:357) IBM.Cloud.SDK.Connection.RESTConnector+d__33.MoveNext ()(位于 Assets/IBMSDKCore/Connection/RESTConnector.cs:646) IBM.Cloud.SDK.Utilities.Runnable+Routine.MoveNext ()(位于 Assets/IBMSDKCore/Utilities/Runnable.cs:131) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)
【问题讨论】:
标签: c# unity3d ibm-cloud text-to-speech ibm-watson