Table of Contents Index NMS Glossary Previous Page Next Page (Page 15 of 69 in this chapter) Version


adiGetEncodingInfo

Description

Returns data size parameters for a given voice encoding format on a specified CTA context.

Prototype

DWORD adiGetEncodingInfo ( CTAHD ctahd,
unsigned encoding,
unsigned *framesize,
unsigned *datarate,
unsigned *maxbufsize )

ctahd CTA context handle returned by ctaCreateContext.

encoding Data encoding method.

framesize Pointer to returned size, in bytes, of a single voice frame for given encoding format.

datarate Pointer to returned required throughput in bytes/second, for given encoding format.

maxbufsize Pointer to returned AG buffer size in bytes, for given encoding format on the specified CTA context. For information specific to the QX board family, refer to the QX 2000 Installation and Developer's Manual.

Return Values

Events

None.

Details

This function returns data size information for the given encoding format on the specified CTA context.

The encoding argument must be one of the valid encoding selectors contained in adidef.h. Each selector is prefixed with ADI_ENCODE_xxx (for example, ADI_ENCODE_NMS_24).

When submitting buffers of voice data for play or record, the buffers must be an integral multiple of the encoding framesize, and should be a multiple of the AG board's physical buffer (maxbufsize). All buffers of voice data submitted to the ADI service must be an integral number of framesize bytes. For example, if the frame size is 62 bytes, a submitted buffer must be sized as n*62 bytes where n=1,2,3....

The datarate is provided to assist resource management optimization. The datarate defines the required throughput between the host CPU and AG board (in bytes/second). It can be used for positioning. For example, to skip ahead four seconds in a message, you would move your data pointer 4*datarate bytes (modulo framesize).

The maxbufsize is the maximum physical AG buffer size for the ctahd's AG board for the given encoding. The AG board's physical buffer size varies depending upon the board type and configured software. The size returned here is rounded to a multiple of the framesize.

For information specific to the QX board family, refer to the QX 2000 Installation and Developer's Manual.

You may pass NULL for any of the function arguments that are pointers to returned values.

Data sizes and encoding are discussed in the ADI Service Developer's Manual.

See Also

adiRecordToMemory, adiRecordAsync, adiStartRecording, adiPlayFromMemory, adiPlayAsync, adiStartPlaying

Example


void myShowEncodingInfo( CTAHD ctahd, unsigned encoding )
{
    unsigned framesize, datarate, maxbufsize;

    if( adiGetEncodingInfo( ctahd, encoding,
                            &framesize, &datarate, &maxbufsize ) == SUCCESS )
    {
        printf( "Frame size   = %d bytes\n",     framesize  );
        printf( "Data rate    = %d bytes/sec\n", datarate   );
        printf( "Max buf size = %d bytes\n",     maxbufsize );
    }
}



Table of Contents Index NMS Glossary Previous Page Next Page (Page 15 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.