Name: revSetSpeechPitch

Type: command

Syntax: revSetSpeechPitch <pitchLevel> 

Summary: Sets the pitch (whether the voice is high or low) to be used with <text to speech>.

Introduced: 2.0

OS: mac,windows

Platforms: desktop,server,web

Example:
revSetSpeechPitch 100

Example:
revSetSpeechPitch (the thumbPosition of scrollbar "Pitch")

Parameters:
pitchLevel (integer): An integer between 30 and 127.

The result: If text to speech is not available on the current system, the <revSetSpeechPitch> <command> sets the <result> <function> to an error message.

Description:
Use the <revSetSpeechPitch> <command> to change the way <text to speech|speech> sounds.

The greater the <pitchLevel>, the higher-pitched the computer is when speaking text with the <revSpeak> <command>. Use a greater <pitchLevel> for a treble voice and a lower <pitchLevel> for a bass voice.

The <pitchLevel> is logarithmically related to the voice frequency: the range 30 to 127 corresponds approximately to the range from 50Hz to 12,000Hz. If you need to convert from Hertz (cycles per second) to the <pitchLevel> numbers used with this <command>, use the following <custom function>:

  function pitchFromHertz theHertzFrequency
    get (ln(theHertzFrequency) - ln(261.625))/ln(1.05946309434)
    return round(60 + it)
  end pitchFromHertz

The pitch specified by the <revSetSpeechPitch> <command> is used for all speeches following the <command> during the current session. If the computer is already speaking when you <execute> the <command>, the new pitch affects the current speech.

>*Important:*  The <revSetSpeechPitch> <command> is part of the <Speech library>. To ensure that the <command> works in a <standalone application>, you must include this <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section on the General screen of the <Standalone Application Settings> window, make sure "Speech" is selected in the list of script libraries.

References: Speech library (library), Revolution custom library (library), revSetSpeechSpeed (command), revSpeak (command), result (function), command (glossary), Standalone Application Settings (glossary), custom function (glossary), text to speech (glossary), standalone application (glossary), execute (glossary), function (control_st)

Tags: multimedia
