User Guide
588 Chapter 12: Methods
Example
These statements stop the speech when the playhead moves to the next frame in the Score:
-- Lingo syntax
on exitFrame
voiceStop()
end exitFrame
// JavaScript syntax
function exitFrame() {
voiceStop();
}
See also
voiceSpeak(), voicePause(), voiceResume(), voiceGetRate(), voiceSetRate(),
voiceGetPitch(), voiceSetPitch(), voiceGetVolume(), voiceSetVolume(),
voiceState(), voiceWordPos(), voiceSpeak()
voiceWordPos()
Usage
-- Lingo syntax
voiceWordPos()
// JavaScript syntax
voiceWordPos(); // documentation n/a
Description
Function; returns an integer indicating the position of the word that is currently being spoken
within the entire string that contains it. For example, if a cast member containing 15 words is
being spoken and the fifth word of the cast member is being spoken when the function is used,
the return value is 5.
Parameters
None.
Example
The following statements cause the sentence “Hello, how are you?” to be spoken and display the
current word position in the Message window. Since the voiceWordPos() function is called
immediately after the
voiceSpeak() command is used, the return value will be 1.
-- Lingo syntax
voiceSpeak(“Hello, how are you?”)
put voiceWordPos()
-- 1
// JavaScript syntax
voiceSpeak("Hello, how are you?");
put(voiceWordPos());
// 1
See also
voiceSpeak(), voicePause(), voiceResume(), voiceStop(), voiceGetRate(),
voiceSetRate(), voiceGetPitch(), voiceSetPitch(), voiceGetVolume(),
voiceSetVolume(), voiceState(), voiceSpeak()