I found this one-line example that allows to use the Windows SAPI Text-to-Speech feature in VBScript:
CreateObject("SAPI.SpVoice").Speak("This is a test")
I wonder if the SAPI Speech Recognition could be used in a VBScript program in the same easy way. When I seek for such information the tons of SAPI information that appear are related to C++, like the Microsoft SAPI site, or to Text-to-Speech in VBS. I tried to find documentation about the SAPI COM object Speech Recognition part that could be used in a VBScript, but found none.
Do you know if such a documentation exists? TIA
EDIT: Additional request added after the first answer was recevied
Although the first answer below provide a link to the SAPI COM object documentation, I want to attract your attention to a point in my question: "I wonder if the SAPI Speech Recognition could be used in a VBScript program IN THE SAME EASY WAY". The SAPI documentation is huge! I read several pages of it and I am completely lost... My goal is to recognize just a few single words, say 8 or 10, and show a different message in the screen each time that one of they was recognized; that is it! (The program should be a console application started via cscript
). Is there a simple example of VBS code that achieve such thing? If the required code to program this solution needs to have several pages, then it is not the answer I am looking for...
cscript //nologo test.vbs
and got this (equivalent) error: "test.vbs(1, 19) Microsoft VBScript compiler error: End of instruction expected". I use Windows 8.1 Spanish version and cscript Windows Script Host version 5.8 – AaciniOn Error Goto MARK
, and you'd have to replace object creation of the formSet RC = New SpSharedRecoContext
withCreateObject()
and the full component name:Set RC = CreateObject("SAPI.SpSharedRecoContext")
. – Ansgar Wiecherscscript.exe
. There are a series of changes intended to adjust the program to the VBS environment, but they never worked. It is much simpler to write a C++ program for this... – Aacini