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


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. If the return is SUCCESS, a VCEEVN_RECORD_DONE event occurs when recording completes.

After recording ends, call vceGetContextInfo to get the number of milliseconds actually recorded and look in the position field of the status.

The voice handle and message number become the current message for the 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:

The VCE_RECORD_PARMS structure contains the following fields:
Field Name

Default

Description

size

*

Size of this structure in bytes.

DTMFabort

0xffff

Abort on DTMF (bit mask).

gain

0 dB

The gain in decibels applied to the signal before it is encoded. If automatic gain control is enabled, this is the initial gain when recording starts.

novoicetime

5000 ms

The maximum length of silence at the beginning of a recording before recording will be stopped with a reason of CTA_REASON_NO_VOICE. Use zero (0) to disable this timer.

silencetime

3000 ms

The maximum length of silence after audio energy has been detected before record will be stopped with a reason of CTA_REASON_VOICE_END. Use zero (0) to disable this timer.

silenceampl

-45 dBm

The maximum signal level, in dBm, that is considered to be silence.

beepfreq

1000 Hz

The frequency of the record beep tone. Use zero (0) to disable the beep.

beepampl

-20 dBm

The amplitude of the beep tone.

beeptime

200 ms

The duration of the beep.

AGCenable

0

Flag to enable automatic gain control.

* The default for size field is sizeof (VCE_RECORD_PARMS).

Note: You cannot initiate a record operation (which uses the ADI Service) if the ADI energy detector is active unless novoicetime and silencetime are both zero.

Refer to
Appendix B 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);
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 31 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.