revSpeak

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
revSpeak <phraseToSpeak>
Associationsspeech library
Summary

Speaks text through the computer's speakers.

Introduced2.0
OSmac, windows
Platformsdesktop, server
Parameters
NameTypeDescription
phraseToSpeak

A string of any length.

Example
revSpeak "Hello world"
revSpeak field "Biography Text"
Values
NameTypeDescription
The result

If text to speech is not available on the current system, the revSpeak command sets the result function to an error message.

RelatedMessage: closeStack, shutdown
Library: Speech library
Glossary: LiveCode custom library, handler, Standalone Application Settings, standalone application, text to speech, execute, command
Control Structure: function
Function: revIsSpeaking, revSpeechVoices, result
Command: revSetSpeechSpeed, revUnloadSpeech, revSetSpeechVoice, revSetSpeechPitch, revSetSpeechVolume
Object: stack
Description

Use the revSpeak command to use the computer's text to speech|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.

Note: 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

Important: 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 text to speech|speech is closed (in a closeStack handler), or when your application quits (in a shutdown handler). This saves memory.

Important: 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.

Tagsmultimedia