Example #1
0
    public void Speak(string toSay, OnErrorCallbackHandler callback) //Llama a la API de Android para TTS
    {
        if (TTSExample == null)
        {
            Initialize();
        }
        this._callback = callback;


        TTSExample.Call("TTSMEWithCallBack", toSay, gameObject.name, "OnError");
    }
    /// <summary>
    /// Initializes the TTS engine with the given parameters.
    /// </summary>
    /// <param name="language"> The language with which the TTS engine initializes.</param>
    /// <param name="speed"> The speed to be set for the TTS engine.</param>
    /// <param name="pitch"> The pitch to be set for the TTS engine.</param>
    /// <param name="volume">The volume to be set for the TTS engine.</param>
    ///
    public void Initialize(Locale language, float speed, float pitch, float volume)
    {
        Initialize();
        this.errorCallback = InitializationError;

        ttsEngine.Call("SpeakWithCallback", "", gameObject.name, "OnError");

        SetLanguage(language);
        SetSpeed(speed);
        SetVolume(volume);
    }
Example #3
0
    public void Speak(string toSay, OnErrorCallbackHandler callback)
    {
        if (TTSExample == null)
        {
            Initialize();
        }
        this._callback = callback;

        if (!Application.isEditor)
        {
            TTSExample.Call("TTSMEWithCallBack", toSay, gameObject.name, "OnError");
        }
    }
    /// <summary>
    /// Performs speech synthesis on the text given. In case an error occurs the callback is called with the error description.
    /// </summary>
    /// <param name="toSpeak"> The text to speak.</param>
    /// <param name="errorCallback"> The method that will be called when an error occurs. The method will be passed a string argument which will contain the error description.</param>
    public void Speak(string toSpeak, OnErrorCallbackHandler errorCallback)
    {
        if (ttsEngine == null)
        {
            //Initialize();
            errorCallback(TTSUninitializedError());
            return;
        }

        this.errorCallback = errorCallback;


        ttsEngine.Call("SpeakWithCallback", toSpeak, gameObject.name, "OnError");
    }
Example #5
0
    /// <summary>
    /// Performs speech synthesis on the text given. In case an error occurs the callback is called with the error description.
    /// </summary>
    /// <param name="toSpeak"> The text to speak.</param>
    /// <param name="errorCallback"> The method that will be called when an error occurs. The method will be passed a string argument which will contain the error description.</param>
    public void Speak(string toSpeak, OnErrorCallbackHandler errorCallback)
    {
        if (ttsEngine == null)
        {
            //Initialize();
            errorCallback("Please initialize the TTS engine prior to performing any actions or changing the settings");
            return;
        }

        this.errorCallback = errorCallback;


        ttsEngine.Call("SpeakWithCallback", toSpeak, gameObject.name, "OnError");
    }