2016-05-13 77 views
0

我可以改變速率和音量,但音調是沒有辦法..... 有沒有什麼辦法可以改變它?如何在Visual Basic中設置音高?

這是代碼:

private void ButtonSpeak_Click(object sender, RoutedEventArgs e) 
{ 
    if (comboVoice.SelectedItem != null) 
    synthesizer.SelectVoice(comboVoice.SelectedItem.ToString()); 
    synthesizer.Volume = Convert.ToInt32(sliderVolume.Value); 
    synthesizer.Rate = Convert.ToInt32(sliderRate.Value); 
    switch (synthesizer.State) 
    { 
      //if synthesizer is ready 
     case SynthesizerState.Ready: 
      synthesizer.SpeakAsync(ConvertRichTextBoxContentsToString()); 
      ButtonSpeak.Content = "Pause"; 
      break; 
      //if synthesizer is paused 
     case SynthesizerState.Paused: 
      synthesizer.Resume(); 
      ButtonSpeak.Content = "Pause"; 
      break; 
      //if synthesizer is speaking 
     case SynthesizerState.Speaking: 
      synthesizer.Pause(); 
      ButtonSpeak.Content = "Resume"; 
      break; 
    } 
} 

非常感謝您的幫助!

+0

幾乎沒有語音實現實際上支持它。聽起來像一個花栗鼠只是不被認爲是一個有用的功能。 –

回答

0

不確定音調,但是如果您使用的是Microsoft System.Speech.Synthesis,則具有VoiceAge屬性,該屬性需要一個影響聲音的Adult或Teen枚舉。

synth.VoiceAge(Adult); 
+0

非常感謝!但是,這改變了現有的聲音或找到了符合這些標準的聲音?請原諒我的英語...... – JaviLG

+0

我認爲這是用來改變現有的語音,但不幸的是,自從我使用語音合成以來,這已經有一段時間了! –

+0

非常感謝@aspiring_expert! – JaviLG