vceErase

Removes data at the current position in the current message.

Prototype

DWORD vceErase ( CTAHD ctahd, unsigned msec, unsigned *actual)

Argument

Description

ctahd

Handle returned by ctaCreateContext or ctaAttachContext.

msec

Amount of data to erase, in milliseconds.

actual

Pointer to returned number of milliseconds erased.


Return values

Return value

Description

SUCCESS

 

CTAERR_FUNCTION_ACTIVE

Playing or recording is active on the context.

CTAERR_INVALID_CTAHD

Context handle is invalid.

CTAERR_SVR_COMM

Server communication error.

VCEERR_INVALID_OPERATION

Either the current file type supports erasing only to the end of the message, or the current message is a list.

VCEERR_NO_MESSAGE

No current message is in the context.

VCEERR_OUT_OF_INDICES

No free header entries are in the destination VOX file.

VCEERR_PLAY_ONLY

The voice object containing the current message is not open for record.


Details

At the current position in the current message, vceErase removes the specified number of milliseconds of data in the context that ctahd specifies. It returns the number of milliseconds deleted in actual, unless actual is NULL.

The current position is unchanged. The current message size is reduced by the amount deleted.

You cannot erase while play or record is active.

If you attempt to erase beyond the end of the current message, SUCCESS is returned and the current position becomes the end of the message.

Erasing data to anywhere except the end of a message is allowed only on file types that fully support editing (currently only VOX files).

EDTX encoding types are not supported.

See also

vceEraseMessage

Example

/* Trim specified number of seconds off end of the current message */

void myTrim (CTAHD ctahd, unsigned seconds)
{
    unsigned msec = seconds*1000 ;

    vceSetPosition (ctahd, msec, VCE_SEEK_END, NULL) ;
    vceErase (ctahd, msec, NULL);
}