news |
info |
people |
software |
stuff |
Say XCMD. Version 1.0d7, by Sam Deane. Copyright ©1994 ULTRALAB. Compiled 16:52:53, 28/04/94. Debugging code included.
The XCMD includes commands to create and dispose speech channels, choose voices and settings for them, and to speak text in to them.
In general the syntax is:
Say "some text..."
Say <command> {,<channel> { other params... }}
The simplest form of the Say command, shown first above, takes a single piece of text , which must be no longer than 255 characters. This text is spoken using the default voice.
To access the more sophisticated and powerful features of the Speech Manager, the second syntax form must be used.
Most Speech Manager commands operate on a sound channel. To make things easy, the XCMD allows you to give each channel that you create a name. When a command needs to refer to a particular channel, you simply pass the channel name in the <channel> parameter. If this parameter is left empty, a default channel is used.
on mouseUp Say text,"test",bg field "text" end mouseUp
Say text,<channel>,<text>
The <channel> parameter should contain the name of a speech channel previously created with the new command.
The <text> parameter should contain the text to be spoken, which can be of any length (memory permitting).
on mouseUp Say text,"test",bg field "text" end mouseUp
Say new,<channel> {,<voice>}
The <channel> parameter should contain the name by which the new channel will be identified. If a channel of this name already exists the command will fail.
If the optional <voice> parameter is used, it should contain the name of the voice to use (for example "Alexander" is the standard male voice supplied with GalaTa). If no name is supplied, or the voice given is not installed, the default system voice will be used instead.
Say dispose,<channel>
This command must be called when you are finished with a speech channel (for example in your closeStack script), otherwise nasty things are likely to happen!
It is safe to dispose a channel at any time - any speech in progress on the channel will be halted at once. If you dispose a channel more than once by accident, the XCMD will return an error message, but nothing fatal will happen.
Say busy {,<channel>}
If the <channel> parameter is used, the command will return a boolean value in the result - true if the channel is speaking, false if it is not.
If the <channel> parameter is not used, the command returns an integer number in the result which indicates how many channels are currently speaking.
on mouseUp answer "Specific channel, or all?" with "Specific" or "All" if it is "All" then Say busy put the result else Say busy,"test" put the result end if end mouseUp
Say voices
on mouseUp Say voices answer the result end mouseUp
Say short,"some text..."
The text is spoken in the default system voice, and cannot be more than 255 characters in length.
To speak a more useful length of text, and to use the other features of the speech manager, you need first to create a speech channel. See the new and text commands.
Say stop,<channel>,<when>
The <when> parameter determines exactly when the channel is stopped. A value of "word" will stop the speech after is has completed the current word. A value of "sentence" will stop the speech after the current sentence. A value of "now" will stop it immeadietly.
on mouseUp ask "When?" with "word" Say stop,"test",it end mouseUp
Say pause,<channel>,<text>
The <when> parameter determines exactly when the channel is paused. A value of "word" will pause the speech after is has completed the current word. A value of "sentence" will pause the speech after the current sentence. A value of "now" will pause it immeadietly.
If a channel has been paused, the continue command will restart it.
on mouseUp ask "When?" with "word" Say pause,"test",it end mouseUp
Say continue,<channel>
on mouseUp Say continue,"test" end mouseUp