(Page 3 of 41 in this chapter) Version
/* Demonstrates playing a text string */
char *text = "$1,234,567";
extern CTAHD CtaHd;
extern CTAQUEUEHD CtaQueueHd;
void mytestprompt ()
{
VCEHD vh;
VCEPROMPTHD prompthandle;
unsigned msglist[50];
unsigned count;
/* Open the associated voice file */
vceOpenFile (CtaHd, "american.vox", VCE_FILETYPE_VOX,
VCE_PLAY_ONLY, 0, &vh);
/* Load the American rules */
vceLoadPromptRules (CtaHd, "american.tbl", &prompthandle );
/* Translate the string into a list of messages in american.vox */
vceBuildPromptList (prompthandle, 0, text, msglist,
sizeof msglist/sizeof msglist[0], &count);
/* Play the messages */
vcePlayList (vh, msglist, count, NULL);
do
{
ctaWaitEvent( CtaQueueHd, &event, CTA_WAIT_FOREVER);
} while (event.id != VCEEVN_PLAY_DONE); /* Ignore other events */
/* Close the rules table */
vceUnloadPromptRules (prompthandle);
/* Close the associated voice file */
vceClose (vh);
}
(Page 3 of 41 in this chapter) Version