I’m getting a list index out of range error for speech to text with the new Watson sdk. The weird thing is that it only occurs with the japanese models. I can change the model to chinese and english and I don’t get the error. The only code I have changed from the ExampleStreaming.cs file is the following:
public bool Active
{
get { return _speechToText.IsListening; }
set
{
if (value && !_speechToText.IsListening)
{
//_speechToText.RecognizeModel = "zh-CN_BroadbandModel";
//_speechToText.RecognizeModel = "en-US_BroadbandModel";
_speechToText.RecognizeModel = "ja-JP_BroadbandModel";
_speechToText.DetectSilence = true;
_speechToText.EnableWordConfidence = true;
_speechToText.EnableTimestamps = true;
_speechToText.SilenceThreshold = 0.01f;
_speechToText.MaxAlternatives = 0;
_speechToText.EnableInterimResults = true;
_speechToText.OnError = OnError;
_speechToText.InactivityTimeout = -1;
_speechToText.ProfanityFilter = false;
_speechToText.SmartFormatting = true;
_speechToText.SpeakerLabels = false;
_speechToText.WordAlternativesThreshold = null;
_speechToText.StartListening(OnRecognize, OnRecognizeSpeaker);
}
else if (!value && _speechToText.IsListening)
{
_speechToText.StopListening();
}
}
}
Here is the error:
[02/26/2018 01:23:03][SpeechToText.OnListenMessage()][ERROR] Error: list index out of range
UnityEngine.Debug:LogError(Object)
IBM.Watson.DeveloperCloud.Debug.DebugReactor:ProcessLog(LogRecord) (at Assets/Watson/Scripts/Debug/DebugReactor.cs:60)
IBM.Watson.DeveloperCloud.Logging.LogSystem:ProcessLog(LogRecord) (at Assets/Watson/Scripts/Logging/Logger.cs:196)
IBM.Watson.DeveloperCloud.Logging.Log:Error(String, String, Object) (at Assets/Watson/Scripts/Logging/Logger.cs:261)
IBM.Watson.DeveloperCloud.Services.SpeechToText.v1.SpeechToText:OnListenMessage(Message) (at Assets/Watson/Scripts/Services/SpeechToText/v1/SpeechToText.cs:789)
IBM.Watson.DeveloperCloud.Connection.c__Iterator0:MoveNext() (at Assets/Watson/Scripts/Connection/WSConnector.cs:286)
IBM.Watson.DeveloperCloud.Utilities.Routine:MoveNext() (at Assets/Watson/Scripts/Utilities/Runnable.cs:128)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)