Following is the source code for a basic and simple program for beginners that shows how to use Microsoft Speech Application Programming Interface (SAPI) in your ASP pages. You may modify it according to your own requirements.
Permission to run and create SAPI objects in ASP pages if you are using Windows 2000/XP
<%
\' Declaring variable to hold SAPI object.
Dim voic
\' Creating SAPI object using spvoice.
Set voic = Server.CreateObject(\"SAPI.SpVoice\")
\' If you want to change the voice then uncomment any of the following 3 lines.
\'Set voic.voice = voic.GetVoices(\"Name=Microsoft mary\", \"Language=409\").Item(0)
\'Set voic.voice = voic.GetVoices(\"Name=Microsoft mike\", \"Language=409\").Item(0)
\'Set voic.voice = voic.GetVoices(\"Name=Microsoft sam\", \"Language=409\").Item(0)
\' you can set other parameters and properties like voice pitch, speed etc.
\' Using speak function of SpVoice to speak a string.
voic.Speak(\"Welcome To My First Speech Enabled ASP Page, Have a nice day!\")
\' Destroying SAPI.spvoice object.
Set voic = nothing
%>