本文介绍了文字转语音转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
文字转语音转换代码,如果有人知道
Text-to-Speech Conversion code if some one knows
推荐答案
using System.Speech.Synthesis;
public class SpeechOutput
{
private static SpeechSynthesizer speaker;
public static void Main(String[] args)
{
speaker = new SpeechSynthesizer();
speaker.SetOutputToDefaultAudioDevice();
//Speed(-10 - 10)
speaker.Rate = 1;
//Volumn (0-100)
speaker.Volume = 100;
//Select Voice
speaker.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);
//Speak the Text (cancel with speaker.CancelAsync())
speaker.SpeakAsync("Hello World");
}
//Additional methods
private static List<VoiceInfo> GetInstalledVoices()
{
var listOfVoiceInfo = from voice
in speaker.GetInstalledVoices()
select voice.VoiceInfo;
return listOfVoiceInfo.ToList<VoiceInfo>();
}
}
using SpeechLib;
SpVoice objSpeech = new SpVoice();
objSpeech.Speak(textBox1.Text,SpeechVoiceSpeakFlags.SVSFlagsAsync);
objSpeech.WaitUntilDone(Timeout.Infinite);
欲了解更多,你可以看到这个链接
如果有帮助,请投票并接受答复。
For more, You can see this link
Click
Click
Click
Click
Please vote and Accept Answer if it Helped.
这篇关于文字转语音转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!