<doc>
  <legacy_id>1218</legacy_id>
  <name>revSetSpeechPitch</name>
  <type>command</type>
  <syntax>
    <example>revSetSpeechPitch <i>pitchLevel</i></example>
  </syntax>
  <library>Speech library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Images &amp; Multimedia</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <command tag="revSetSpeechSpeed">revSetSpeechSpeed Command</command>
  </references>
  <history>
    <introduced version="2.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
  </security>
  <summary>Sets the pitch (whether the voice is high or low) to be used with <glossary tag="text to speech">text to speech</glossary>.</summary>
  <examples>
    <example>revSetSpeechPitch 100</example>
    <example>revSetSpeechPitch (the thumbPosition of scrollbar "Pitch")</example>
  </examples>
  <description>
    <p>Use the <b>revSetSpeechPitch</b> <glossary tag="command">command</glossary> to change the way <glossary tag="text to speech">speech</glossary> sounds.</p><p/><p><b>Parameters:</b></p><p>The <i>pitchLevel</i> is an <keyword tag="integer">integer</keyword> between 30 and 127. </p><p/><p><b>Comments:</b></p><p>The greater the <i>pitchLevel</i>, the higher-pitched the computer is when speaking text with the <command tag="revSpeak">revSpeak</command> <glossary tag="command">command</glossary>. Use a greater <i>pitchLevel</i> for a treble voice and a lower <i>pitchLevel</i> for a bass voice.</p><p/><p>The <i>pitchLevel</i> 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 <i>pitchLevel</i> numbers used with this <glossary tag="command">command</glossary>, use the following <href tag="dictionary/property/2381.xml">custom function</href>:</p><p/><p>  function pitchFromHertz theHertzFrequency</p><p>    get (ln(theHertzFrequency) - ln(261.625))/ln(1.05946309434)</p><p>    return round(60 + it)</p><p>  end pitchFromHertz</p><p/><p>The pitch specified by the <b>revSetSpeechPitch</b> <glossary tag="command">command</glossary> is used for all speeches following the <glossary tag="command">command</glossary> during the current session. If the computer is already speaking when you <glossary tag="execute">execute</glossary> the <glossary tag="command">command</glossary>, the new pitch affects the current speech.</p><p/><p>If text to speech is not available on the current system, the <b>revSetSpeechPitch</b> <glossary tag="command">command</glossary> sets the <function tag="result">result</function> <control_st tag="function">function</control_st> to an error message.</p><p/><p><img src="202653"/> <b>Important!</b> The <b>revSetSpeechPitch</b> <glossary tag="command">command</glossary> is part of the <glossary tag="Speech library">Speech library</glossary>. To ensure that the <glossary tag="command">command</glossary> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section on the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure "Speech" is selected in the list of script libraries.</p>
  </description>
</doc>