Home arrow Delphi-Kylix arrow Page 3 - Delphi and Microsoft Agent
DELPHI-KYLIX

Delphi and Microsoft Agent


While writing a letter in MS Word, I accidentally clicked on the help button and this animated little thing on a a bike jumped up and presented me with an input box. I’ve seen it a few times before, but this time I wondered if I could write a program that could animate characters in Delphi.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
November 01, 2006
TABLE OF CONTENTS:
  1. · Delphi and Microsoft Agent
  2. · Using the Agent in Delphi
  3. · Modifying speech out
  4. · Other features of the Agent

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Delphi and Microsoft Agent - Modifying speech out
(Page 3 of 4 )

In the previous section we used the Speak() procedure to make Merlin read the text in the memo. We can use that method to modify speech by using tags. These  tags can be used to change the output expression of the character. Speech tags follow a very specific format:

  1. All tags begin and end with a backslash character ().
  2. Tags are white space dependent i.e Merlin is not the same as Merlin .
  3. The single backslash character is not enabled within a tag. To include a backslash character in a text parameter of a tag, use a double backslash.
  4. Tags are case insensitive, i.e Merlin is the same as MERLIN.

From the Microsoft documentation there are eleven main tags that can be used to alter speech output. Below are some of them as laid out in the Microsoft Documentation:

Chr

Description: Sets the character of the voice.

Syntax: Chr=string

String: A string specifying the character of the voice.

Part

Description

"Normal" (default)

A normal tone of voice

"Monotone"

A monotone voice

"Whisper"

A whispered voice

Ctx Tag

Description: Sets the context of the output text.

Syntax: Ctx=string

String: A string specifying the context of the text that follows, which determines how symbols or abbreviations are spoken.

Part

Description

"Address"

Addresses and/or phone numbers.

"E-mail"

 Electronic mail.

 "Unknown" (default)

 Context is unknown.

 

Lst Tag

Description: Repeats last spoken statement for the character.

Syntax: Lst

Remarks: This tag enables a character to repeat its last spoken statement. This tag must appear by itself in the Speak method; no other text or parameters can be included. When the spoken text is repeated, any other tags included in the original text are repeated, except for bookmarks. Any .WAV and .LWV files included in the text are also repeated.

Map Tag

Description: Maps spoken text to text displayed in the word balloon.

Syntax: Map="spokentext"="balloontext"

Remarks: This tag enables you to use different spoken text than that displayed in the word balloon.

Part

Description

spokentext

A string specifying the text for spoken output.

balloontext

A string specifying the text for word balloon output.

Mrk Tag

Description: Defines a bookmark in the spoken text.

Syntax: Mrk=number

Remarks: When the server processes a bookmark, it generates a bookmark event. You must specify a number greater than zero (0) and not equal to 2147483647 or 2147483646.

Part

Description

number

A Long integer value that identifies the bookmark.

Pau Tag

Description: Pauses speech for the specified number of milliseconds.

Syntax: Pau=number

Part

Description

number

The number of milliseconds to pause.

Pit Tag

Description: Sets the baseline pitch of the output to the specified value in hertz.

Syntax: Pit=number

Remarks: This tag is supported only for TTS-generated output. The range of values for the parameter may vary depending on the installed TTS engine.

Part

Description

number

The pitch in hertz. 

There are a couple more that you can use to make your agent speak in a way that you like. To make Merlin whisper the text that he reads off the memo, change the code in the button1 procedure from this:

procedure TForm1.Button1Click(Sender: TObject);
begin
Merlin.show(false);
Merlin.speak(memo1.text, '');
end;

To this:

procedure TForm1.Button1Click(Sender: TObject);
begin
Merlin.show(false);
Merlin.speak(Chr="Whisper"memo1.text, '');
end;


blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials