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


vceSetWaveInfo

Description

Loads a new entry in the WAVE encoding table.

Prototype

DWORD vceSetWaveInfo ( CTAHD ctahd,
unsigned
encoding,
VCE_WAVE_INFO *waveinfo)

ctahd Handle returned by ctaCreateContext.

encoding Encoding ID.

waveinfo Buffer to receive the following VCE_WAVE_INFO structure:

typedef struct
{
DWORD size;
WORD format;
WORD nchannels;
DWORD samplespersec;
DWORD datarate;
WORD blocksize;
DWORD bitspersample;
} VCE_WAVE_INFO;
The VCE_WAVE_INFO structure fields are described in the Details section.

Return Values

Events

Details

This function adds an entry to the Voice Message service's wave information table. This table is maintained by the voice service to map encoding values to WAVE file header information. It is used by vceCreateFile to create a new WAVE file for a specified encoding and by vceOpenFile to determine the encoding used in an existing WAVE file.

The table contains compiled-in entries for all of the encoding values in vcedef.h. If an attached player/recorder service makes another encoding available, then in order to play or record WAVE files with the new encoding, a new entry must be added to the table using vceSetWaveInfo.

The VCE_WAVE_INFO structure contains the following fields:
Field

Description

size

Size of the structure, in bytes. This is set to:
sizeof (VCE_WAVE_INFO).

format

The WAVE format type as defined by Microsoft, for example, WAVE_FORMAT_PCM (defined in the Microsoft header file mmreg.h).

nchannels

The number of discrete channels in the format. Use 1 for mono and 2 for stereo.

samplespersec

The sample rate in samples per second.

datarate

Average bytes per second.

blockalign

The minimum block size of the data. For PCM data, the block size is the number of bytes in a single sample.

bitspersample

Number of bits per sample.

See Also

vceGetWaveInfo

Example


/*
* Add 11khz 8 bit stereo PCM encoding to the WAVE info table.
* The encoding value is passed in.
*/

#define WAVE_FORMAT_PCM 1 /* As defined in mmreg.h */

DWORD myAdd11khzStereo(CTAHD ctahd, unsigned encoding)
{
VCE_WAVE_INFO waveinfo;
waveinfo.size = sizeof waveinfo ;
waveinfo.format = WAVE_FORMAT_PCM;
waveinfo.nchannels = 2; /* stereo */
waveinfo.samplespersec = 11025;
waveinfo.datarate = 22050; /* bytes per second */
waveinfo.blocksize = 2; /* 2 8-bit channels */
waveinfo.bitspersample = 8;

return vceSetWaveInfo(ctahd, encoding, &waveinfo);
}


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