RE: SAPI5 speech via COM in AutoIt, VBNET, & C#

  • From: "Lloyd Rasmussen" <lras@xxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 11 Sep 2007 23:55:28 -0400

I stayed up a few more minutes.  Btxt.inc is an include file which the COM
browser can create, showing you the methods by which a program can call that
particular DLL.  That, too, will have to wait.

#COMPILE EXE
#INCLUDE "vtxt.inc"
' This version uses early-binding
' Text-To-Speech engine test code by Lance C. Edmonds, PowerBASIC , Inc.
' Tested on Windows 2000.  The speech engine components can
' be obtained from www.msdn.microsoft.com ...search for "Speech"
' ------------------------------------------------------------
' Written for PB Console Compiler, Version 3
' updated for PBWin 7.04 by Lloyd Rasmussen 2004/09/06
' It actually works!
'----------

FUNCTION PBMAIN
    DIM oSp AS SpeechVTxtAuto
    DIM oVnt1 AS VARIANT
    DIM oVnt2 AS VARIANT
    DIM oVTxt AS VARIANT
    DIM oVFlg AS VARIANT
    SET oSp = NEW SpeechVTxtAuto IN $PROGID_SpeechVoiceText1
    IF ISFALSE ISOBJECT(oSp) THEN
        MSGBOX "Speech engine failed!",,"Speech_test"
                EXIT FUNCTION
    END IF
    oVnt1 = ""
    oVnt2 = "Test PB App"
    OBJECT CALL oSp.Register(oVnt1, oVnt2)
IF COMMAND$ = "" THEN _
                         oVTxt = "Hi.  Include the text you want spoken on
the command line which runs this program" _
ELSE OVTXT = COMMAND$
    oVFlg = %vtxtst_COMMAND
    OBJECT CALL oSp.Speak(oVTxt,oVFlg)
    ' Give the Speech engine a chance to finish
    DO
        SLEEP 50
        OBJECT GET oSp.IsSpeaking() TO oVFlg
    LOOP WHILE VARIANT#(oVFlg)
    SET oSp = NOTHING

    END FUNCTION

Lloyd Rasmussen, Kensington, Maryland
Home:  http://lras.home.sprynet.com
Work:  http://www.loc.gov/nls
 
> -----Original Message-----
> From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-
> bounce@xxxxxxxxxxxxx] On Behalf Of Lloyd Rasmussen
> Sent: Tuesday, September 11, 2007 11:40 PM
> To: programmingblind@xxxxxxxxxxxxx
> Subject: RE: SAPI5 speech via COM in AutoIt, VBNET, & C#
> 
> Actually, the calling conventions for SAPI 4 are somewhat different.  And
> a
> change Microsoft made a few months ago which disables JavaScript's ability
> to call SAPI 4 implies that there are some bugs in SAPI 4 which Microsoft
> doesn't plan to fix.  Remember that SAPI 5 has been out for 5 or 6 years,
> and SAPI 4 is older.
> 
> I was going to paste into this message the code of a PowerBasic program
> which uses the first available SAPI 4 engine to speak whatever is on the
> command line.  It can be called from batch files or CMD files.  The
> executable is on my web site.  I think this is one of the programs that
> got
> Jamal started on Windows programming.  It is derived from another PB
> program
> written by one of PowerBasic's staffers for the console version of their
> compiler.  But the source is on a different machine, and this will have to
> wait for another night.
> 
> 
> Lloyd Rasmussen, Kensington, Maryland
> Home:  http://lras.home.sprynet.com
> Work:  http://www.loc.gov/nls
> 
> > -----Original Message-----
> > From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-
> > bounce@xxxxxxxxxxxxx] On Behalf Of Littlefield, Tyler
> > Sent: Tuesday, September 11, 2007 10:57 PM
> > To: programmingblind@xxxxxxxxxxxxx
> > Subject: Re: SAPI5 speech via COM in AutoIt, VBNET, & C#
> >
> > what's so big about sapi 4? I'd venture to guess, it'd be the same.
> > I don't see m$ changing their whole interface from one ver to the
> next...
> > :)
> > Thanks,
> > Tyler Littlefield.
> > Vertigo head coder
> > "My programs don't have bugs, just randomly added features."
> > msn: compgeek134@xxxxxxxxxxx
> > email: compgeek13@xxxxxxxxx
> > aim: st8amnd2005
> > skype: st8amnd127
...

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: