Exemple #1
0
 public void Speak(string voicer, double volume, double rate, string content)
 {
     if (Voicers.Contains(voicer) == false)
     {
         return;
     }
     Check(ref volume, ref rate);
     BeginWork(() =>
     {
         Synth.SelectVoice(voicer);
         Synth.Volume = (int)volume;
         Synth.Rate   = (int)rate;
         Synth.Speak(content);
     });
 }
Exemple #2
0
 public void Generated(string voicer, double volume, double rate, string content, string file)
 {
     if (Voicers.Contains(voicer) == false)
     {
         return;
     }
     Check(ref volume, ref rate);
     BeginWork(() =>
     {
         var path = new System.IO.FileInfo(file);
         if (path.Directory.Exists == false)
         {
             System.IO.Directory.CreateDirectory(path.Directory.FullName);
         }
         Synth.SelectVoice(voicer);
         Synth.Volume = (int)volume;
         Synth.Rate   = (int)rate;
         Synth.SetOutputToWaveFile(file);
         Synth.Speak(content);
         Synth.SetOutputToDefaultAudioDevice();
     });
 }