Jump to Real's How-to Main page

Use Microsoft Speech API (SAPI)

The Microsoft Speech API is included with XP (or higher).

For 2000/9x, install Microsoft Speech Engine.
http://activex.microsoft.com/activex/controls/sapi/spchapi.exe

Good infos about this API can be found at
http://www.microsoft.com/technet/scriptcenter/funzone/games/sapi.mspx

Dim oVo
Set oVo = Wscript.CreateObject("SAPI.SpVoice")

If oVo Is Nothing Then
   WScript.Exho "FAILED Sapi.SpVoice creation"
Else
   oVo.Speak "Real's How To"
  
   Set oVo.Voice = oVo.GetVoices.Item(0)
   // Microsoft Sam (the default voice)
   oVo.Speak oVo.GetVoices.Item(0).GetDescription
   
   While Not Ovo.WaitUntilDone(0)
     WScript.Sleep 100
   Wend
End If

WScript.Echo "Done."

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2007
[ home ]