Opens/initializes a particular speech engine, for use with other REXX Speech functions.
Synopsis
voice = SpeechOpen(engine, window, messageNum)
Args
engine is the ID of the desired speech engine to open/initialize. This is returned from SpeechVoiceDlg(). If engine is omitted, then the default speech engine is opened, whatever it may be on a given system.
window is the handle of some window you created. This window is passed a message whenever text (that you pass to SpeechSpeak) starts speaking. The window is also passed another message when that same text finishes speaking. If window is omitted, then it is assumed that you are not using any GUI add-on in your script, and will not use asynchronous operation for SpeechSpeak().
messageNum is the "message" (number) parameter of the message passed to your window. If messageNum is omitted, then the message number will be WM_APP + 1000 (ie, 33768).
Returns
If success, the voice parameter is returned. If a failure, then an empty string is returned.
Notes
If there is a problem allocating memory to initialize the speech engine, then a SYNTAX condition is raised. CONDITION('E') returns error number 5 and CONDITION('D') returns the message System resources exhausted.
If you pass a non-numeric value for window, then a SYNTAX condition is raised. CONDITION('E') returns error number 40.12 and CONDITION('D') returns the message SpeechOpen argument 2 must be a whole number; found "<badarg>" where <badarg> is what you erroneously passed.
If you pass a non-numeric value for messageNum, then a SYNTAX condition is raised. CONDITION('E') returns error number 40.12 and CONDITION('D') returns the message SpeechOpen argument 3 must be a whole number; found "<badarg>" where <badarg> is what you erroneously passed.
Examples
If your script uses a GUI add-on such as REXX GUI, see the example in a GUI script. Otherwise, see a non-GUI script.