Table of Contents Index NMS Glossary Previous Page Next Page (Page 26 of 41 in this chapter) Version


vcePlayList

Description

Starts playing a list of messages.

Prototype

DWORD vcePlayList ( VCEHD vh,
unsigned messagelist[],
unsigned count,
VCE_PLAY_PARMS *parms)

vh Handle of an open voice object.

messagelist List of message numbers in vh to play as one contiguous message.

count Number of messages in messagelist.

parms Pointer to a parameter structure. Set this to NULL to use default values. The VCE_PLAY_PARMS structure is:

typedef struct
{
DWORD size;
DWORD DTMFabort;
INT32 gain;
DWORD speed;
DWORD maxspeed;
} VCE_PLAY_PARMS;
See the Details section for a description of these fields.

Return Values

Event

Details

This function starts playing from the beginning of the first message in messagelist. Messages in the list are played as one contiguous message with no delays between messages.

This function allows a message to be built from a library of words or phrases contained in a single voice object. To concatenate messages from multiple objects, use vceSetCurrentList, followed by vcePlay.

vcsPlayList always returns immediately and, if it returns SUCCESS, a VCEEVN_PLAY_DONE event occurs when play completes.

If there are no messages or if all messages have a length of zero (0), the VCEEVN_PLAY_DONE event occurs immediately.

The VCE_PLAY_PARMS structure contains the following fields:
Field Name

Default

Description

size

sizeof (VCE_PLAY_PARMS)

Size of this structure in bytes.

DTMFabort

0xffff

Abort on DTMF (bit mask).

gain

0 dB

Playing gain in decibels, or VCE_CURRENT_VALUE to use the most recent gain setting.

speed

100%

Initial speed in percent or VCE_CURRENT_VALUE to use the most recent speed setting.

maxspeed

100%

Maximum play speed in percent.

Note: Refer to Appendix B for more information about the play parameters.

After play ends, call vceGetContextInfo to get the number of milliseconds actually played and look at the position field of the returned structure.

The list of messages becomes the current message for the context specified by ctahd. After play stops, resume playing from the current position with vcePlay. Use vceSetPosition to adjust the current position to anywhere in the list before resuming.

See Also

vceBuildPromptList, vceGetContextInfo, vcePlay, vcePlayMessage, vceSetCurrentList, vceSetPosition, vceStop

Example


/* Play digit string from prompt file */

/*
* This routine starts speaking a digit string.
* The spoken digits "oh" through "nine" are in 10 messages in
* DIGITS.VOX where msg 0 = "oh", msg 1 = "one", etc.
*/

extern CTAHD CtaHd;
extern CTAQUEUEHD CtaQueueHd;

void mySpeakDigits (char *digits)
{
unsigned msglist[50];
unsigned count;
VCEHD vh;
CTA_EVENT event;

vceOpenFile (Ctahd, "DIGITS.VOX", 0, VCE_PLAY_ONLY, 0, &vh) ;

for (count = 0;
*digits != '\0' && count < sizeof msglist/sizeof msglist[0];
digits++)
{
if (isdigit(*digits))
msglist[count++] = *digits - '0' ;
}

vcePlayList(vh, msglist, count, NULL);
do
{
ctaWaitEvent( CtaQueueHd, &event, CTA_WAIT_FOREVER);
} while (event.id != VCEEVN_PLAY_DONE); /* Ignore other events */
vceClose(vh);
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 26 of 41 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights reserved.