/// <summary>
 /// Called on availability of synthesized data.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="TranslationSynthesisEventArgs"/> instance containing the event data.</param>
 private void OnSynthesis(object sender, TranslationSynthesisResultEventArgs e)
 {
     if (e.Result.Status == SynthesisStatus.Success)
     {
         using (var m = new MemoryStream(e.Result.Audio))
         {
             SoundPlayer simpleSound = new SoundPlayer(m);
             simpleSound.Play();
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Called on availability of synthesized data.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="TranslationSynthesisEventArgs"/> instance containing the event data.</param>
 private void OnSynthesis(object sender, TranslationSynthesisResultEventArgs e)
 {
     Console.WriteLine("hoge0");
     Console.WriteLine(e.Result.Status);
     if (e.Result.Status == SynthesisStatus.Success)
     {
         Console.WriteLine("hoge1");
         using (var m = new MemoryStream(e.Result.Audio))
         {
             Console.WriteLine("hoge2");
             SoundPlayer simpleSound = new SoundPlayer(m);
             simpleSound.Play();
         }
     }
 }