(Page 31 of 40 in this chapter)


vceSetCurrentList

Description

Defines the current message to be a list of messages.

Prototype

DWORD vceSetCurrentList ( CTAHD ctahd,
VCE_MESSAGE msglist[],
unsigned count)

ctahd Handle returned by ctaCreateContext.

msglist Pointer to an array of the VCE_MESSAGE structure:

typedef struct
{
VCEHD vh;
unsigned message;
} VCE_MESSAGE;
See the Details section for a description of these fields.

count Number of elements in the msglist array.

Return Values

Events

Details

This function defines the current message for the CTA context specified by ctahd. The current message can consist of a list of messages, which will be treated as one contiguous message.

Messages can be in different files or memory blocks but all must have been opened with ctahd as the context and all must have the same encoding.

The VCE_MESSAGE structure contains the following fields:

Field

Description

vh

Handle of an open voice object.

message

Message number in the voice object specified by vh.

To define a single current message, define a list with one element or use vceSetCurrentMessage.

Use vceSetCurrentList to select a message list prior to using the following position-oriented functions: vceSetPosition, vcePlay, and vceRead.

If any message in msglist does not exist, vceSetCurrentList returns SUCCESS as long as the message number is one that could exist in the corresponding vh. If any message is out of range, the function returns VCEERR_INVALID_MESSAGE.

You cannot set the current message while play or record is active.

Use vceGetCurrentList to query the current message.

See Also

vceGetCurrentList, vcePlay, vceRead, vceSetCurrentMessage

Example


/* Play digit string from multiple prompt files */

/* This routine starts speaking a digit string */
/* The spoken digits "oh" through "nine" are in message 0 in
* 10 separate files. The open file handles are in an array vh[] where
* vh[0] = "oh", vh[1] = "one", etc.
*/

extern CTAHD ctahd;

VCEHD Vh[10]; /* Array of open file handles */

void mySpeakDigitString (char *digits)
{
VCE_MESSAGE msglist[50];
unsigned count;
CTA_EVENT event;

/* Convert the digit string into a list of VCE_MESSAGE structs */
for (count = 0;
*digits != '\0' && count < sizeof msglist/sizeof msglist[0];
digits++)
{
if (isdigit(*digits))
{
msglist[count].vh = Vh[*digits - '0'];
msglist[count].message = 0;
++ count;
}
}

vceSetCurrentList(ctahd, msglist, count) ;
vcePlay (ctahd, VCE_NO_TIME_LIMIT, NULL) ;
do
{
ctaWaitEvent( CtaQueueHd, &event, CTA_WAIT_FOREVER);
} while (event.id != VCEEVN_PLAY_DONE);/* Ignore other events */
}


(Page 31 of 40 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.