Assets/Watson/Scripts/Services/SpeechToText/SpeechToText.cs
/// <summary>
/// This starts the service listening and it will invoke the callback for any recognized speech.
/// OnListen() must be called by the user to queue audio data to send to the service. 
/// StopListening() should be called when you want to stop listening.
/// </summary>
/// <param name="callback">All recognize results are passed to this callback.</param>
/// <returns>Returns true on success, false on failure.</returns>
This starts the service listening and it will invoke the callback for any recognized speech.
OnListen() must be called by the user to queue audio data to send to the service.
StopListening() should be called when you want to stop listening.
This starts the service listening and it will invoke the callback for any recognized speech . OnListen () must be called by the user to queue audio data to send to the service . StopListening () should be called when you want to stop listening .
public bool StartListening(OnRecognize callback)
        {            
            if (callback == null)
                throw new ArgumentNullException("callback");
            if (m_IsListening)
                return false;
            if (!CreateListenConnector())
                return false;
            m_IsListening = true;
            m_ListenCallback = callback;
            m_KeepAliveRoutine = Runnable.Run(KeepAlive());
            m_LastKeepAlive = DateTime.Now;
            return true;
        }
public bool StartListening ( OnRecognize callback ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( m_IsListening ) return false ; if ( ! CreateListenConnector ( ) ) return false ; m_IsListening = true ; m_ListenCallback = callback ; m_KeepAliveRoutine = Runnable . Run ( KeepAlive ( ) ) ; m_LastKeepAlive = DateTime . Now ; return true ; }
This starts the service listening and it will invoke the callback for any recognized speech.
This starts the service listening and it will invoke the callback for any recognized speech .
Returns true on success, false on failure.
Returns true on success false on failure .
callback
OnRecognize
All recognize results are passed to this callback.
All recognize results are passed to this callback .