Beispiel #1
0
 private void speak(bool bAsync, System.Speech.Synthesis.PromptBuilder pb, bool in_save_to_file, string in_filename)
 {
     try
     {
         if (in_save_to_file)
         {
             SSS.PromptStyle ps = new System.Speech.Synthesis.PromptStyle(SSS.PromptRate.ExtraSlow);
             ps.Emphasis = SSS.PromptEmphasis.Moderate;
             ps.Volume   = SSS.PromptVolume.Soft;
             pb.AppendBreak(new TimeSpan(0, 0, 1));
             pb.StartStyle(ps);
             ss.SetOutputToNull();
             delOutFile(Application.StartupPath + "\\" + in_filename);
             ss.SetOutputToWaveFile(Application.StartupPath + "\\" + in_filename);
             pb.EndStyle();
         }
         if (bAsync)
         {
             ss.SpeakAsync(pb);
         }
         else
         {
             ss.Speak(pb);
         }
     }
     catch (Exception ex)
     {
         speak("An error occured:" + ex.Message, false);
     }
 }
Beispiel #2
0
 private void speak(bool in_async, string in_text)
 {
     try
     {
         SSS.PromptBuilder pb = new System.Speech.Synthesis.PromptBuilder();
         pb.AppendText(in_text);
         strSaidLast = in_text;
         ListViewItem lvi = lvSpoken.Items.Add(in_text);
         lvi.SubItems.Add(DateTime.Now.ToLongTimeString());
         lvi.EnsureVisible();
         speak(in_async, pb);
     }
     catch (Exception ex)
     {
         speak("An error occured:" + ex.Message, false);
     }
 }
Beispiel #3
0
 private void speak(System.Speech.Synthesis.PromptBuilder pb, bool in_save_to_file)
 {
     try
     {
         if (in_save_to_file)
         {
             ss.SetOutputToNull();
             delOutFile();
             ss.SetOutputToWaveFile(strOutputFile);
         }
         ss.SpeakAsync(pb);
     }
     catch (Exception ex)
     {
         speak("An error occured:" + ex.Message, false);
     }
 }
Beispiel #4
0
 private void speak(bool bAsync, System.Speech.Synthesis.PromptBuilder pb)
 {
     try
     {
         if (bSaveFile)
         {
             ss.SetOutputToNull();
             delOutFile();
             ss.SetOutputToWaveFile(strOutputFile);
         }
         if (bAsync)
         {
             ss.SpeakAsync(pb);
         }
         else
         {
             ss.Speak(pb);
         }
     }
     catch (Exception ex)
     {
         speak("An error occured:" + ex.Message, false);
     }
 }
Beispiel #5
0
 public void Speak(PromptBuilder promptBuilder)
 {
     Speak(new Prompt(promptBuilder));
 }
Beispiel #6
0
 public Prompt(PromptBuilder promptBuilder)
 {
     Helpers.ThrowIfNull(promptBuilder, "promptBuilder");
     _text  = promptBuilder.ToXml();
     _media = SynthesisMediaType.Ssml;
 }
Beispiel #7
0
        private void speak(bool in_async, string in_text)
        {
            try
            {

                SSS.PromptBuilder pb = new System.Speech.Synthesis.PromptBuilder();
                pb.AppendText(in_text);
                strSaidLast = in_text;
                ListViewItem lvi = lvSpoken.Items.Add(in_text);
                lvi.SubItems.Add(DateTime.Now.ToLongTimeString());
                lvi.EnsureVisible();
                speak(in_async,pb);
            }
            catch (Exception ex)
            {
                speak("An error occured:" + ex.Message, false);
            }
        }