Bookmark This Site

How to make use of SAPI in your ASP pages

How to make use of SAPI in your ASP pages

Author: Jamal Ahmad Malik
Submission Date: 2006-04-20
Website:
Email:

Overview

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.

Requirements

Microsoft SAPI 5.1

Internet Information Server OR Personal Web Server

Permission to run and create SAPI objects in ASP pages if you are using Windows 2000/XP

Source Code

<%

\' 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

%>

Rate this article: Lowest = 1 to Highest = 5
View PDF   Bookmark   Printer Friendly

[ ^Top ]    [ Go Back ]