SpeechVolume

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

Synopsis

result = SpeechVolume(voice, volume)

Args

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

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

Returns

If setting the volume, then an empty string is returned ("") if SpeechVolume is successful, or an error message is returned for error. If querying the current volume, then that volume value is returned if SpeechVolume 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 "SpeechVolume"; argument 1 is required.

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

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

Examples
/* Get the current volume. */
volume = SpeechVolume(voice)
IF volume == "" THEN SAY 'Error getting volume'

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