Beispiel #1
0
        public static bool PauseSpeaking(SpeechBoundary speechBoundary = SpeechBoundary.Word)
        {
#if UNITY_IOS
            if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.tvOS)
            {
                switch (speechBoundary)
                {
                case SpeechBoundary.Immediate:
                    return(_PauseSpeakingImmediate());

                case SpeechBoundary.Word:
                    return(_PauseSpeakingEndOfWord());

                default:
                    throw new ArgumentOutOfRangeException("speechBoundary", speechBoundary, "SpeechBoundary not supported");
                }
            }
#endif
            return(false);
        }
Beispiel #2
0
        public static bool StopSpeaking(SpeechBoundary speechBoundary = SpeechBoundary.Immediate)
        {
#if UNITY_IOS
            if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.tvOS)
            {
                switch (speechBoundary)
                {
                case SpeechBoundary.Immediate:
                    Try(_StopSpeakingImmediate, false, "Error Stopping Speech Immediate");
                    break;

                case SpeechBoundary.Word:
                    Try(_StopSpeakingEndOfWord, false, "Error Stopping Speech End Of Word");
                    break;

                default:
                    throw new ArgumentOutOfRangeException("speechBoundary", speechBoundary, "SpeechBoundary not supported");
                }
            }
#endif
            return(false);
        }
Beispiel #3
0
 /// <summary>
 /// Stops all speech at the specified boundary constraint.
 /// </summary>
 /// <param name="speechBoundary">A constant describing whether speech should stop immediately or only after finishing the word currently being spoken.</param>
 /// <returns>true if speech has stopped, or false otherwise.</returns>
 public static bool Stop(SpeechBoundary speechBoundary)
 {
     return(TTS_iOS.StopSpeaking(speechBoundary));
 }
Beispiel #4
0
 /// <summary>
 /// Pauses speech at the specified boundary constraint.
 /// </summary>
 /// <param name="speechBoundary">A constant describing whether speech should pause immediately or only after finishing the word currently being spoken.</param>
 /// <returns>true if speech has paused, or false otherwise.</returns>
 public static bool Pause(SpeechBoundary speechBoundary)
 {
     return(TTS_iOS.PauseSpeaking(speechBoundary));
 }
Beispiel #5
0
 //Called from Button
 public void SetSpeechBoundary(int speechBoundary)
 {
     _speechBoundary = (SpeechBoundary)speechBoundary;
 }