(Page 12 of 40 in this chapter)


vceGetContextInfo

Description

Gets the current Voice Message service status of the specified CTA context.

Prototype

DWORD vceGetContextInfo ( CTAHD ctahd,
VCE_CONTEXT_INFO
*status,
unsigned size)

ctahd Handle returned by ctaCreateContext.

status Pointer to a buffer to receive the VCE_CONTEXT_INFO structure:

typedef struct
{
DWORD size;
DWORD numcurrent;
DWORD position;
DWORD reasondone;
DWORD auxerror;
DWORD function;
DWORD underruns;
DWORD currentgain;
DWORD currentspeed;
DWORD encoding;
DWORD framesize;
DWORD frametime;
} VCE_CONTEXT_INFO;
See the Details section for a description of these fields.

size Size in bytes of the status buffer.

Return Values

Events

Details

This function retrieves the current Voice Message service status information of the CTA context specified by ctahd.

This function returns information about the current or most recent play or record operation on a CTA context.

A context contains a current message and current position, used by functions including vcePlay, vceRecord, vceErase, vceRead, and vceWrite. The current message can consist of a list of messages which will be treated as one contiguous message. The numcurrent field in the VCE_CONTEXT_INFO structure gives the number of messages in the list.

Use vceGetCurrentList to view the current message or list.

Note: During play or record, the current position is updated as each buffer is internally submitted for play or completed for record. When play ends, the values may be adjusted downward if not all of the bytes submitted to the device were actually played.

The VCE_CONTEXT_INFO structure contains the following fields:

Field

Description

size

Number of bytes written to the buffer pointed to by status.

numcurrent

Number of messages that comprise the current message list. Use vceGetCurrentList to see the messages.

position

Current position, in milliseconds, in the current message.

reasondone

Reason for completion of the most recent play or record.

auxerror

Auxiliary error code (for example, OS error).

function

VCE_PLAY or VCE_RECORD if a function is currently active, otherwise zero (0).

underruns

Count of underruns. An underrun occurs when the system is unable to supply buffers to the hardware fast enough to keep up with speech. The underrun count is cumulative from when the CTA context is opened.

currentgain

The current value of play gain. This value is set to the value of the play gain parameter when play starts and can be changed by vceSetPlayGain when play is active.

currentspeed

The current value of play speed. This value is set to the value of the play speed parameter when play starts and can be changed by vceSetPlaySpeed when play is active.

encoding

Encoding of the current message.

framesize

Frame size of the current encoding. See vceGetEncodingInfo.

frametime

Frame duration of the current encoding. See vceGetEncodingInfo.

See Also

vceGetCurrentList, vceGetEncodingInfo, vceGetOpenInfo

Example


/* Get the underrun count */

unsigned myGetUnderruns (CTAHD ctahd)
{
VCE_CONTEXT_INFO contextinfo;

vceGetContextInfo (ctahd, &contextinfo, sizeof contextinfo);
return contextinfo.underruns;
}


(Page 12 of 40 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.