2016-04-02 17 views
-1

Bu dünyada yeni biriyim, bazı garip şeylerle ilgili sorun yaşıyorum, Windows 7 Text To Speech Voice to Ivona Brina bilgisayarımın varsayılan sesini değiştirdim Ben ses,Bir uygulamada konuşma sentezi sesi nasıl seçilir

VE

Ben o zaman çift gel benim programa leke zaman başka bir sorun yok, burada

C# benim tam kodu

ilk MS ANNA aynıdır benim programı çalıştırmak
using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows.Forms; 
using System.Speech.Synthesis; 
using System.Speech.Recognition; 
using System.Threading; 
using System.Diagnostics; 
using System.Globalization; 
using System.IO; 


namespace VoiceRs 
{ 
    public partial class Form1 : Form 
    { 
     public Form1() 
     { 
      InitializeComponent(); 
      this.button1.Click += new EventHandler(button1_Click); 
      this.button2.Click += new EventHandler(button2_Click); 
      this.button3.Click += new EventHandler(button3_Click); 

      foreach (InstalledVoice voice in sSynth.GetInstalledVoices()) 
      { 
       Console.WriteLine(voice.VoiceInfo.Name); 
      } 
     } 
     SpeechSynthesizer sSynth = new SpeechSynthesizer(); 
     PromptBuilder pBuilder = new PromptBuilder(); 
     SpeechRecognitionEngine sRecognize = new SpeechRecognitionEngine(); 

     private void Form1_Load(object sender, EventArgs e) 
     { 

     } 

     private void button1_Click(object sender, EventArgs e) 
     { 
      pBuilder.ClearContent(); 
      pBuilder.AppendText(textBox1.Text); 
      sSynth.SelectVoice("IVONA 2 Brian"); 
      sSynth.Speak(pBuilder); 
     } 

     private void button2_Click(object sender, EventArgs e) 
     { 
      button2.Enabled = false; 
      button3.Enabled = true; 
      Choices sList = new Choices(); 
      sList.Add(new string[] { "hello", "test", "it works", "how", "are", "you", "today", "i", "am", "fine", "exit", "close", "quit", "so", "hello how are you" }); 
      Grammar gr = new Grammar(new GrammarBuilder(sList)); 
      try 
      { 
       sRecognize.RequestRecognizerUpdate(); 
       sRecognize.LoadGrammar(gr); 
       sRecognize.SpeechRecognized += sRecognize_SpeechRecognized; 
       sRecognize.SetInputToDefaultAudioDevice(); 
       sRecognize.RecognizeAsync(RecognizeMode.Multiple); 
       sRecognize.Recognize(); 
      } 

      catch 
      { 
       return; 
      } 
     } 

     private void button3_Click(object sender, EventArgs e) 
     { 
      sRecognize.RecognizeAsyncStop(); 
      button2.Enabled = true; 
      button3.Enabled = false; 
     } 

     private void sRecognize_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) 
     { 


      if (e.Result.Text == "exit") 
      { 
       Application.Exit(); 
      } 
      else 
      { 
       textBox1.Text = textBox1.Text + " " + e.Result.Text.ToString(); 
      } 

     } 

     private void textBox1_TextChanged(object sender, EventArgs e) 
     { 

     } 
    } 
} 

ve burada benim tam projedir: ClickLink yardım lütfen, teşekkür ederim ... İşte

Ben IVONA 2 Brian yükleyin olduğumu kanıtlamak edilir enter image description here

cevap

0

bu MSDN örneğini çalıştırmayı deneyin ve olup olmadığını görmek IVONA sesini duyabiliyorum.

private void button1_Click(object sender, EventArgs e) 
{ 
    using (SpeechSynthesizer synth = new SpeechSynthesizer()) 
    { 
     // Configure the audio output 
     synth.SetOutputToDefaultAudioDevice(); 

     // Build a prompt 
     PromptBuilder builder = new PromptBuilder(); 
     builder.AppendText("That is a big pizza!"); 

     foreach (InstalledVoice voice in synth.GetInstalledVoices()) 
     { 
      VoiceInfo info = voice.VoiceInfo; 

      // Select voice 
      synth.SelectVoice(info.Name); 

      // Speak the prompt 
      synth.Speak(builder); 
     } 
    } 
} 
+0

Ben Ok Büyük IVONA 2 Brian http://i.stack.imgur.com/MoJ5y.png –

+0

yükleyin olduğumu bu bakın, kodu güncelledik, bu deneyin ve sonuçlarını paylaşır. – Nemo

+0

Hayır efendim orada iyileştirme yok .... Hala Aynı ses duydum ...... –