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


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 context (for example, 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);
}


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