Jump to content

Programming Help:Speech Tags

From Agentpedia, the Microsoft Agent encyclopedia

The Microsoft Agent API supports modifying speech output through special tags inserted in the speech string inside of the Speak method. Speech tags follow the following rules of syntax:

  • All tags begin and end with a backlash (\).
  • The single backslash character is not enabled within a tag.
  • Tags are case-insensitive but are however whitespace dependent. For example, \Chr\ is the same \chr\ but not \ Chr \.
  • As some tags include quoted strings, you may have to double-quote in some languages to include them in the speech method. For example: Peedy.Speak("\Chr=""Whisper""\This is me whispering!")

The following speech tags are supported: Chr, Ctx, Emp, Lst, Map, Mrk, Pau, Pit, Rst, Spd, Vol

Chr Tag

Sets the character of the voice.

Syntax: \Chr=string\

Part Description
"Normal" (Default) A normal tone of voice.
"Monotone" A monotone voice.
"Whisper" A whispered voice.

Ctx Tag

Sets the context of the output text. This determines how symbols or abbreviations are spoken by the character.

Syntax: \Ctx=string\

Part Description
"Address" Addresses/phone numbers.
"E-Mail" Electronic mail.
"Unknown" (Default) Unknown context.

Emp Tag

Emphasizes the next work spoken and must precede the word.

Syntax: \Emp\

Lst Tag

Repeats last spoken statement for the character. This tag must appear by itself in the Speak method with no other text or parameters.

Syntax: \Lst\

Map Tag

Maps spoken text to text displayed in the word balloon.

Syntax: \Map="spokentext"="balloontext"\

Part Description
spokentext A string for spoken output.
balloontext A string for balloon output.

Mrk Tag

Defines a bookmark in the spoken text. You must specify a number greater than 0 and not equal to 2147483647 or 2147483646.

Syntax: \Mrk=number\

Pau Tag

Pauses speech for the the number of milliseconds specified.

Syntax: \Pau=number\

Pit Tag

Sets the baseline pitch of the output in hertz.

Syntax: \pit=number\

Rst Tag

Resets all tags to default settings.

Syntax: \Rst\

Spd Tag

Sets the baseline average talking speed of the output in words per minute.

Syntax: \spd=number\

Vol Tag

Sets the speaking volume of the speech output. 0 is silence and 65536 is the maximum volume.

Syntax: \vol=number\