Macromedia Director MX Lingo TTS Functions
The new Lingo functions and commands provide the Director MX author unparalleled control over the text-to-speech capabilities. As a Director MX author, you can create accessible self-voicing content independent of screen readers or other assistive technologies. The content you create will be more flexible and useable for users with disabilities.
For example, when you use voiceInitialize ( ), you can control whether a user’s computer has loaded the voice capabilities needed to play the movie.
if voiceInitialize() then
/*The voice is ready to go*/
go frame "My movie is ready";
else
/*wait for the voice to load*/
go the frame
end if
end
New Lingo functions and commands:
- voiceCount ( )
-
Returns the number of installed voices available to the text-to-speech engine. The return value is an integer, and represents the number of voices that can be used with voiceSet( ) and voiceGet( ) to specify a particular voice to be active.
- voiceGet ( )
-
Returns the current voice of the speech synthesis as an integer. Use voiceCount( ) to determine the number of available voices.
- voiceGetPitch ( )
-
Returns the current pitch for the current voice. The valid range of values depends on the operating system platform and text-to-speech engine.
- voiceGetRate ( )
-
Returns the current playback rate of the text-to-speech engine. The return value is an integer. The valid range of values depends on the operating system platform. In general, values between -10 and 10 can be expected.
- voiceGetVolume ( )
-
Returns the current volume of the text-to-speech synthesis. The value returned is an integer. The valid range of values depends on the operating system platform.
- voiceInitialize ( )
-
Loads the computer’s text-to-speech engine. The command returns 1 if successful, 0 otherwise.
- voicePause ( )
-
Pauses the speech output to the text-to-speech engine. The command returns a value of 0 if it’s successful, or 1 if it’s not.
- voiceResume ( )
-
Resumes the speech output to the text-to-speech engine. The command returns a value of 0 if it’s successful, or 1 if it’s not.
- voiceSet ( )
-
Sets the current voice of the text-to-speech synthesis. The value specified must be an integer. The valid range of values depends of the user’s computer. If an out-of-range value is specified, the voice is set to the nearest valid value. If successful, the command returns the new value that was set. Use voiceCount() to determine the number of available voices.
- voiceSetPitch ( )
-
Sets the pitch for the current voice of the text-to-speech engine to the specified value. The return value is the new pitch value that has been set. The valid range of values depends on the operating-system platform and text-to-speech engine.
- voiceSetRate( )
-
Sets the playback rate of the text-to-speech engine to the specified integer value. The command returns the new value that’s been set. The valid range of values depends on the operating system platform. In general, values between -10 and 10 are appropriate for most text-to-speech engines. If an out-of-range value is specified, the rate will be set to the nearest valid value.
- voiceSetVolume ( )
-
Set the volume of the text-to-speech synthesis. The specified value must be an integer. The range of valid values depends on the operating system platform. If successful, the command returns the new value that was set. If an invalid value is specified, the volume is set to the nearest valid value.
- voiceSpeak ( )
-
Causes the specified string to be spoken by the text-to-speech engine. When this command is used, any speech currently in progress is interrupted by the new string.
- voiceState ( )
-
Returns the current status of the voice as a symbol. The possible return values are #playing, #paused, and #stopped.
- voiceStop ( )
-
Stops the speech output to the text-to-speech engine and empties the text-to-speech buffer. The command returns a value of 0 if it is successful, or 1 if it’s not.
- voiceWordPos ( )
-
Returns an integer indicating the postion of the word that’s 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.
