SpeechSpeed

Sets the speed of the speaking voice. Or, queries the current speed setting.

Synopsis

result = SpeechSpeed(voice, speed)

Args

voice is the voice parameter that was returned by SpeechOpen().

speed is supplied only if you wish to set the speed to a new value. In that case, speed is the new value in percent (from 0 to 100). If speed is omitted, then SpeechSpeed() simply returns the current speed setting.

Returns

If setting the speed, then an empty string is returned ("") if SpeechSpeed is successful, or an error message is returned for error. If querying the current speed, then that speed value is returned if SpeechSpeed is successful, or an an empty string is returned for error.

Notes

If you omit voice, or pass an empty string, a SYNTAX condition is raised. CONDITION('E') returns error number 40.5 and CONDITION('D') returns the message Missing argument in invocation of "SpeechSpeed"; argument 1 is required.

If you pass a speed that is not numeric, a SYNTAX condition is raised. CONDITION('E') returns error number 40.5 and CONDITION('D') returns the message SpeechSpeed argument 2 must be a whole number; found <arg> where <arg> is what you erroneously supplied.

Passing a speed setting that is lower or higher than the speech engine's limits, causes SpeechSpeed() to use the appropriate, closest setting.

Examples

/* Get the current speed. */
speed = SpeechSpeed(voice)
IF speed == "" THEN SAY 'Error getting speed'

/* Set the speed to 50. */
error = SpeechSpeed(voice, 50)
IF error \== "" THEN SAY 'Error setting speed:' error