Some basic (and a bit more advanced) examples of using the Windows Speech API in JScript:
jscript code:
var oVoice = new ActiveXObject("SAPI.SpVoice");
with (oVoice) {
Voice = GetVoices()[0];
Volume = 100;
// basic example
Rate = 1;
Speak("Hello. This is a basic example of the speech Windows API");
// XML example, changing pitch
Rate = -2;
Speak('<pitch middle="-25">Hello, I am a robot</pitch>' ,8);
// XML example, using some other tags
Rate = 0;
Speak('<pitch absmiddle="30"><rate absspeed="-2">Now I\'m going to use a whining voice to spell the word: school<silence msec="500"/><rate speed="-3"><spell>school</spell></rate></rate></pitch>', 8);
// XML example, difference in pronunciations
Rate = 0;
Speak('Did you <partofsp part="verb">record</partofsp> that <partofsp part="noun">record</partofsp>?',8);
}
You can do a lot more though.
The SAPI help file (sapi.chm) can be downloaded from:
http://www.microsoft.com/downloads/en/details.asp...-B0EE-6583171B4530