Example #1
0
        protected virtual void OnSpokenSentence(string Sentence)
        {
            SpokenSentence spoken = new SpokenSentence();

            spoken.Sentence = Sentence;
            OnSpokenSentenceEvent(spoken);
        }
Example #2
0
        protected virtual void OnSpokenSentenceEvent(SpokenSentence spokenSentence)
        {
            EventHandler <SpokenSentence> handler = SpokenSentenceEvent;

            if (handler != null)
            {
                handler(this, spokenSentence);
            }
        }
Example #3
0
        protected virtual void OnSAPISpeakingSentence(object sender, SpeakProgressEventArgs eventArgs)
        {
            IsSpeaking = true;

            int index = eventArgs.CharacterPosition + eventArgs.CharacterCount;

            if (index > 0)
            {
                index = index - 1;
            }

            if (index > SpeakingSentence.Length)
            {
                index = SpeakingSentence.Length;
            }

            string         SpokenString   = SpeakingSentence.Substring(0, index);
            SpokenSentence spokenSentence = new SpokenSentence();

            spokenSentence.Sentence = SpokenString;
            OnSpokenSentenceEvent(spokenSentence);
        }