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
精彩评论