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


vceRecord

Description

Starts recording at the current position in the current message.

Prototype

DWORD vceRecord ( CTAHD ctahd,
unsigned maxtime,
unsigned insertmode,
VCE_RECORD_PARMS *parms)

ctahd Handle returned by ctaCreateContext.

maxtime Maximum amount to record, in milliseconds. Specify VCE_NO_TIME_LIMIT to record with no time limit.

insertmode VCE_OVERWRITE or VCE_INSERT.

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 initiates recording from the current position in the current message for the specified context.

vceRecord always returns immediately. If the return is SUCCESS, a VCEEVN_RECORD_DONE event occurs when recording completes.

Note: If the message has zero length, the DONE event occurs immediately and there will not be a beep.

Set insertmode to VCE_OVERWRITE to replace existing data without changing the message size.

Set insertmode to VCE_INSERT to insert new data before the current position. If the current position is the end of the message, VCE_INSERT appends the new data to the current message. Inserting data to anywhere except the end of a message is allowed only on file types that support editing (currently only VOX files).

On completion, the current position will be after the inserted data for either insert mode.

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 set to zero.

Refer to
Appendix B for more information about the record parameters.

The current position will be advanced by the number of milliseconds recorded. The number of milliseconds recorded is reported in the size field of the VCEEVN_RECORD_DONE event.

See Also

vcePlayMessage, vceRecordMessage, vceSetCurrentMessage, vceStop

Example


/* Append to an existing message */
extern CTAHD CtaHd;
extern CTAQUEUEHD CtaQueueHd;

void myAppend (VCEHD vh, unsigned message, int maxseconds)
{
CTA_EVENT event;
unsigned maxtime = maxseconds * 1000 ;

vceSetCurrentMessage (vh, message) ;
vceSetPosition (CtaHd, 0, VCE_SEEK_END, NULL) ;
vceRecord (CtaHd, maxtime, VCE_INSERT, NULL);
do
{
ctaWaitEvent( CtaQueueHd, &event, CTA_WAIT_FOREVER);
} while (event.id != VCEEVN_RECORD_DONE);/* Ignore other events */
}


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