(Page 15 of 40 in this chapter)


vceGetEncodingInfo

Description

Gets information about a voice encoding.

Prototype

DWORD vceGetEncodingInfo ( CTAHD ctahd,
unsigned encoding,
unsigned *framesize,
unsigned *frametime)

ctahd Handle returned by ctaCreateContext.

encoding The encoding ID, for example, VCE_ENCODE_NMS_24.

framesize Pointer to the returned size (in bytes) of one frame. This can be NULL.

frametime Pointer to the returned time (in milliseconds) represented by one frame. This can be NULL.

Return Values

Events

None.

Details

This function returns information about any encoding that is supported by the Play/Record service associated with the CTA context (e.g., the ADI service).

framesize is the minimum data block size. Data at the specified encoding will always be a multiple of this size. frametime is the duration to play or record one frame. The data rate in bytes per second is framesize * 1000 / frametime.

Use the following formulas to convert between milliseconds and bytes. Note that these translations truncate the results to frame multiples.

Bytes = ( milliseconds / frametime ) * framesize

Milliseconds = ( bytes / framesize ) * frametime

Use vceGetOpenInfo to get the encoding used in an open voice object.

See Also

vceGetOpenInfo

Example


/* Return message size in bytes */

unsigned myMsgSize (VCEHD vh, unsigned message)
{
VCE_OPEN_INFO openinfo;
unsigned framesize;
unsigned frametime;
unsigned msgsize;

vceGetOpenInfo (vh, &openinfo, sizeof openinfo) ;
vceGetEncodingInfo (openinfo.ctahd, openinfo.encoding, &framesize,
&frametime) ;
vceGetMessageSize (vh, message, &msgsize) ;
return (msgsize / frametime * framesize);
}


(Page 15 of 40 in this chapter)


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