revSpeak
Type
command
Summary
Speaks text through the computer's speakers.
Syntax
revSpeak <phraseToSpeak>
Description
Use the revSpeak command to use the computer's text-to-speech capability.
The revSpeak command uses the voice, pitch, and speed specified by the revSetSpeechVoice, revSetSpeechPitch, and revSetSpeechSpeed commands. If you haven't used these commands during the current session to specify a voice, pitch, or speed, the system's settings are used.
If you execute the revSpeak command while another speech is being spoken, the first speech is stopped and the second speech begins immediately. To find out whether the computer is already speaking, use the revIsSpeaking function, as in the following example:
if revIsSpeaking() then answer \"Just a moment...\"
else revSpeak it
If your application uses text to speech, you should execute the revUnloadSpeech command either when your application is finished using text to speech, when the stack that uses speech is closed (in a closeStack handler), or when your application quits (in a shutdown handler). This saves memory.
The revSpeak command is part of the Speech library. To ensure that the command works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Speech" library checkbox is checked.
Parameters
Name | Type | Description |
---|---|---|
phraseToSpeak | string | A string of any length. |
Examples
revSpeak "Hello world"
revSpeak field "Biography Text"
Related
command: revSetSpeechSpeed, revUnloadSpeech, revSetSpeechVoice, revSetSpeechPitch, revSetSpeechVolume
control structure: function
function: revIsSpeaking, revSpeechVoices, result
glossary: LiveCode custom library, handler, Standalone Application Settings, standalone application, text to speech, execute, command
library: Speech library
message: closeStack, shutdown
object: stack
Compatibility and Support
Introduced
LiveCode 2.0
OS
mac
windows
Platforms
desktop
server