Voice Message Service Developer's Reference Manual (6422-12): Alphabetical Function Reference
(Page 20 of 40 in this chapter)
vceGetWaveInfo
Description
- Gets wave header information for a given encoding value.
Prototype
- DWORD vceGetWaveInfo ( CTAHD ctahd,
unsigned encoding,
VCE_WAVE_INFO *waveinfo,
unsigned size)
- ctahd Handle returned by ctaCreateContext.
- encoding Encoding ID, e.g., VCE_ENCODE_NMS_24.
- waveinfo Pointer to the 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 fields are described in the Details section.
- size Size in bytes of the waveinfo buffer.
Return Values
Events
Details
- This function retrieves information from the Voice Message service's WAVE information table for a specified encoding. The Voice service maintains a table that maps encoding values to WAVE file header information. This is used by vceCreateFile to create a new WAVE file and by vceOpenFile to determine the encoding of the file. For more information about WAVE files, refer to the Microsoft Windows Multimedia Programmer's Reference.
- The table initially contains compiled-in entries for known encodings. New entries may be added with vceSetWaveInfo.
- The VCE_WAVE_INFO structure contains the following fields:
See Also
- vceCreateFile, vceOpenFile, vceSetWaveInfo
Example
/* Display contents of wave info table */
/* Sample output:
*
* Encoding Wave Type M/S SampleRate DataRate Block Bits
* ----------------------------------------------------------
* 1 56 M 8000 2100 42 2
*/
void myShowWaveInfo (CTAHD ctahd)
{
unsigned encoding;
VCE_WAVE_INFO waveinfo;
printf("Encoding Wave Type M/S" " SampleRate DataRate Block Bits\n");
printf("------------------------" "---------------------------------\n");
for (encoding = 0; encoding < 256; encoding ++)
{
if (vceGetWaveInfo(ctahd,encoding,&waveinfo,sizeof waveinfo)!= SUCCESS)
continue;
printf(" %3d %3d %c" " %6d %6d %3d %2d\n",
encoding,
waveinfo.format,
waveinfo.nchannels == 1 ? 'M' : 'S',
waveinfo.samplespersec,
waveinfo.datarate,
waveinfo.blocksize,
waveinfo.bitspersample); }
}
Sample Run
Encoding Wave Type M/S SampleRate DataRate Block Bits
----------------------------------------------------------
1 56 M 8000 2100 42 2
2 56 M 8000 3100 62 3
3 56 M 8000 4100 82 4
4 56 M 8000 8200 162 8
10 7 M 8000 8000 1 8
11 6 M 8000 8000 1 8
13 1 M 8000 16000 2 16
14 23 M 6000 3000 1 4
15 23 M 8000 4000 1 4
16 1 M 11025 11025 1 8
17 1 M 11025 22050 2 16
22 17 M 6000 6600 244 4
23 17 M 8000 8800 244 4
(Page 20 of 40 in this chapter)
tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights
reserved.