[英]text-to-speech using VB.NET 2008
text-to-speech for English language using Visual Basic 2008 使用Visual Basic 2008的英语文本到语音转换
Dim speech As Object = CreateObject("SAPI.SpVoice")
speech.speak(TextBox1.Text)
My question, how this can be used for other languages(Spoken Languages!!!)? 我的问题是,如何将其用于其他语言(口语!!!)? thanks
谢谢
The SAPI interface got a nice wrapper in .NET 3.0, System.Speech.Synthesis namespace. SAPI接口在.NET 3.0 System.Speech.Synthesis命名空间中得到了很好的包装。 Usable in any .NET compatible language.
可用于任何.NET兼容语言。 Use Project > Add Reference and select System.Speech.
使用项目>添加引用,然后选择System.Speech。 Write code similar to :
编写类似以下内容的代码:
Imports System.Speech.Synthesis
...
Dim synth = New SpeechSynthesizer
synth.Speak("Works in any .NET language")
The Sapi interface is a COM-interface. Sapi接口是COM接口。 You can use this with most languages (on windows) which support COM, eg PHP, C, VBA, ...
您可以将其用于支持COM的大多数语言(在Windows上),例如PHP,C,VBA等。
...but if you mean real-world languages, you have to install additional "voices" ...但是如果您指的是真实世界的语言,则必须安装其他“语音”
You can also have this below as your code for embedding a text reader into your program; 您也可以在下面将其作为将文本阅读器嵌入程序中的代码。
Imports System.Speech
Imports System.Speech.Synthesis
........
Dim reader As SpeechSynthesizer = New SpeechSynthesizer
......
Reader.SpeakAsync(textbox1.text)
Reader.SpeakAsync("The above code assigns reader to read the text in textbox1")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.