예제 #1
0
        /// <summary>
        /// Stop immediately synthesis and audio output of the current text. When this
        /// function returns, the audio output is fully stopped and the synthesizer is ready to
        /// synthesize a new message.
        /// </summary>
        public void Cancel()
        {
            espeak_ERROR result = espeak_Cancel();

            if (result == espeak_ERROR.EE_INTERNAL_ERROR)
            {
                throw new InvalidOperationException("Internal error in the eSpeak library.");
            }
        }
예제 #2
0
        /// <summary>
        /// Synthesizes the given text, returning it in whatever fashion was set in the constructor.
        /// </summary>
        /// <param name="text">
        /// A <see cref="System.String"/>
        /// </param>
        public void Synthesize(string text)
        {
            CheckIfTerminated();

            espeak_ERROR result = espeak_Synth(text, text.ToCharArray().Length, 0, 1, 0, 0, IntPtr.Zero, IntPtr.Zero);

            if (result == espeak_ERROR.EE_INTERNAL_ERROR)
            {
                throw new InvalidOperationException("Internal error in the eSpeak library.");
            }
        }
예제 #3
0
        /// <summary>
        /// Speaks a single char through the configured methods.
        /// </summary>
        public void SpeakChar(char toSpeak)
        {
            CheckIfTerminated();

            espeak_ERROR result = espeak_Char(toSpeak);

            if (result == espeak_ERROR.EE_INTERNAL_ERROR)
            {
                throw new InvalidOperationException("Internal error in the eSpeak library.");
            }
        }