Starts recording at the current position in the current message.
DWORD vceRecord ( CTAHD ctahd, unsigned maxtime, unsigned insertmode, VCE_RECORD_PARMS *parms)
|
Argument |
Description |
|
ctahd |
Handle returned by ctaCreateContext or ctaAttachContext. |
|
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 Refer to VCE_RECORD_PARMS for a description of these fields. |
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_FUNCTION_ACTIVE |
Playing or recording is already active on the context. |
|
CTAERR_INVALID_CTAHD |
Context handle is invalid. |
|
CTAERR_OUTPUT_ACTIVE |
Another function is controlling the MVIP output timeslot associated with the context. |
|
CTAERR_RESOURCE_CONFLICT |
Energy detector is in use in the ADI service. |
|
CTAERR_SVR_COMM |
Server communication error. |
|
VCEERR_INVALID_OPERATION |
Insertion anywhere except at the end of a message is not supported by the file type of the current message. The operation is also invalid if the current message is a list. |
|
VCEERR_NO_MESSAGE |
No current message in the context. |
|
VCEERR_OUT_OF_INDICES |
No free header entries in the destination VOX file. |
|
VCEERR_PLAY_ONLY |
Voice file was not opened for record. |
|
Event |
Description |
|
VCEEVN_RECORD_DONE |
Recording completed. The value field of the event contains one of the following reasons or an error code: CTA_REASON_DIGIT CTA_REASON_FINISHED CTA_REASON_NO_VOICE CTA_REASON_RELEASED CTA_REASON_STOPPED CTA_REASON_TIMEOUT CTA_REASON_VOICE_END CTAERR_FUNCTION_NOT_AVAIL CTAERR_RESOURCE_CONFLICT |
vceRecord 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 is not 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 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 is after the inserted data for either insert mode.
EDTX encoding types are not supported.
When the ADI energy detector is active, initiate a record operation (which uses the ADI service) by setting novoicetime and silencetime to zero. For more information about the record parameters, refer to VCE_RECORD_PARMS.
The current position is advanced by the number of milliseconds recorded. The number of milliseconds recorded is reported in the size field of the VCEEVN_RECORD_DONE event.
Refer to Recording for more information.
vcePlayMessage, vceRecordMessage, vceSetCurrentMessage, vceStop
/* 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 */
}