(Page 30 of 40 in this chapter)
vceRecordMessage
Description
- Records a message in an open voice object.
Prototype
- DWORD vceRecordMessage ( VCEHD vh,
unsigned message,
unsigned maxtime,
VCE_RECORD_PARMS *parms)
- vh Handle of an open voice object.
- message Message number to record.
- maxtime Maximum amount to record, in milliseconds. Specify VCE_NO_TIME_LIMIT to record with no time limit.
- parms Pointer to a parameter structure. Set this to NULL to use default values. The VCE_RECORD_PARMS structure is:
typedef struct
{
DWORD size;
DWORD DTMFabort;
INT32 gain;
DWORD novoicetime;
DWORD silencetime;
INT32 silenceampl;
DWORD beepfreq;
INT32 beepampl;
DWORD beeptime;
DWORD AGCenable;
} VCE_RECORD_PARMS;
- See the Details section for a description of these fields.
Return Values
Events
Details
- This function starts recording to the specified message number in the voice object specified by vh. Any existing data in the message will be erased.
- vceRecordMessage always returns immediately and, if the return is SUCCESS, a VCEEVN_RECORD_DONE event occurs when recording completes.
- After recording ends, you can call vceGetContextInfo to get the number of milliseconds actually recorded, by looking in the position field of the status.
- The voice handle and message number become the current message for the CTA context in which the voice handle was opened. After recording stops, you can resume recording at the end of the current message with vceRecord.
- To trim data at the end of the recording:
- Use vceErase to erase data to the end of the message.
- The VCE_RECORD_PARMS structure contains the following fields:
- * The default for size field is sizeof (VCE_RECORD_PARMS).
Note: Refer to Appendix C for more information about the record parameters.
See Also
- vceRecord, vceStop
Example
/* Record to an existing VOX file. */
extern CTAQUEUEHD CtaQueueHd;
void myRecordFile (CTAHD ctahd, char *filename, unsigned msgnum)
{
VCEHD vh;
CTA_EVENT event;
vceOpenFile (ctahd, filename, VCE_FILETYPE_VOX,
VCE_PLAY_RECORD, 0, &vh) ;
vceRecordMessage (vh, msgnum, VCE_NO_TIME_LIMIT, NULL) ;
do
{
ctaWaitEvent( CtaQueueHd, &event, CTA_WAIT_FOREVER);
} while (event.id != VCEEVN_RECORD_DONE);/* Ignore other events */
vceClose (vh);
}
(Page 30 of 40 in this chapter)
tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights
reserved.