开发者

text-to-speech using VB.NET 2008

开发者 https://www.devze.com 2023-02-14 01:54 出处:网络
text-to-speech for English language using Visual Basic 2008 Dim speech As Object = CreateObject(\"SAPI.SpVoice\")

text-to-speech for English language using Visual Basic 2008

Dim speech As Object = CreateObject("SAPI.SpVoice") 
speech.speak(TextBox1.Text) 

My question, how this can be used开发者_如何学C for other languages(Spoken Languages!!!)? thanks


The SAPI interface got a nice wrapper in .NET 3.0, System.Speech.Synthesis namespace. Usable in any .NET compatible language. Use Project > Add Reference and select 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. You can use this with most languages (on windows) which support COM, e.g. PHP, C, VBA, ...

...but if you mean real-world languages, you have to install additional "voices"

  • http://en.wikipedia.org/wiki/Microsoft_text-to-speech_voices
  • http://www.bytecool.com/voices.htm
0

精彩评论

暂无评论...
验证码 换一张
取 消