Sets the pitch of the speaking voice. Or, queries the current pitch setting.
Synopsis
result = SpeechPitch(voice, pitch)
Args
voice is the voice parameter that was returned by SpeechOpen().
pitch is supplied only if you wish to set the pitch to a new value. In that case, pitch is the new value in percent (from 0 to 100). If pitch is omitted, then SpeechPitch() simply returns the current pitch setting.
Returns
If setting the pitch, then an empty string is returned ("") if SpeechPitch is successful, or an error message is returned for error. If querying the current pitch, then that pitch value is returned if SpeechPitch 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 "SpeechPitch"; argument 1 is required.
If you pass a pitch that is not numeric, a SYNTAX condition is raised. CONDITION('E') returns error number 40.5 and CONDITION('D') returns the message SpeechPitch argument 2 must be a whole number; found <arg> where <arg> is what you erroneously supplied.
Passing a pitch setting that is lower or higher than the speech engine's limits, causes SpeechPitch() to use the appropriate, closest setting.
Examples
/* Get the current pitch. */ pitch = SpeechPitch(voice) IF pitch == "" THEN SAY 'Error getting pitch' /* Set the pitch to 50. */ error = SpeechPitch(voice, 50) IF error \== "" THEN SAY 'Error setting pitch:' error