DekGenius.com
Team LiB   Previous Section   Next Section
Embedded Speech Commands

The earlier examples used embedded speech commands like "[[ emph - ]]," which de-emphasizes the pronunciation of the word following the command. These embedded commands give the scripter more control over how the voice sounds when it reads text, such as the volume and emphasis of syllables. The commands are delimited by two pairs of opening and closing brackets ("[[ ]]"). Most of the commands have parameters. For instance, the emphasis command ("emph") has a plus (+) or minus (-) parameter that either gives greater or less emphasis to the word following the command. The following web site contains more information on embedded speech commands: http://developer.apple.com/techpubs/mac/Sound/Sound-200.html.

[[ char LTRL ]]

If you use the LTRL parameter, then the speech synthesizer will read every letter, number, and space separately rather than the words themselves. It reads the words normally if you use NORM as the parameter.

[[ cmnt here is a comment ]]

Use this syntax to enter comments in the speech code. The speech synthesizer will not read the comments text.

[[ emph - ]]

This command de-emphasizes or emphasizes (e.g., [[ emph + ]]) the word that follows the command.

[[ inpt PHON ]]

This command determines whether the speech synthesizer speaks the text in normal text mode or phoneme mode. Phonemic mode spells words as they sound, as in "Maykael" rather than "Michael." If you use [[ inpt PHON ]] then the speech synthesizer will use phonemic mode. The command [[ inpt TEXT ]] is the default.

[[ nmbr LTRL ]]

This command determines the number-speaking mode of the speech synthesizer. The syntax example would read the code say [[ nmbr NORM ]] 500 as "five hundred"; whereas the code say [[ nmbr LTRL ]] 500 would be read as "five zero zero."

[[ pbas +1 ]]

The baseline pitch command makes the voice higher or lower. If you use a + or - symbol with the real number parameter (in a range from 1.0 to 127.0), the pitch is adjusted relative to its current value.

[[ pmod +1]]

The pitch modulation command also changes the sound attributes of the computer voice. If you use a + or - symbol with the real number parameter (in a range from 0.0 to 127.0), the modulation is adjusted relative to its current value.

[[ rate +50]]

The speech rate determines how fast the text is read. For example, [[ rate +50 ]] speeds up the speech synthesizer's reading of text. The rate number parameter falls between 0.0 and 65535.999, a range that equates to 50 to 500 words per minute.

[[ rset ]]

Use the reset command to reset the voice attributes back to their default values.

[[ slnc 500 ]]

The silence command causes a speech delay for parameter number of milliseconds (there are 1,000 milliseconds in a second). So if you want two seconds of silence followed by the word "heaven," you could use the code say "[[ slnc 2000 ]] heaven".

[[ volm +0.5 ]]

The speech volume command adjusts the voice's volume (how loud it is) in a range from 0.0 to 1.0. If you precede the parameter with a + or - symbol, the volume is adjusted based on its current value.

    Team LiB   Previous Section   Next Section