Voice Message Service Developer's Reference Manual (6422-16): Alphabetical Function Reference
(Page 5 of 41 in this chapter) Version
vceConvertMessage
Description
- Copies a message and translates its encoding.
Prototype
- DWORD vceConvertMessage ( VCEHD srcvh,
unsigned srcmsg,
VCEHD destvh,
unsigned destmsg,
int gain)
- srcvh Voice handle of source file or memory block.
- srcmsg Source message number.
- destvh Voice handle of destination file or memory block.
- destmsg Destination message number.
- gain Amplification if positive, or attenuation if negative.
Return Values
Events
Details
- This function copies a message from one voice object to another, or to another message in the same voice object. The encoding of the message will be translated as needed from the source the destination. If the gain argument is not zero (0), attenuation or amplification will be applied, depending on whether gain is negative or positive.
- Source and destination must belong to the same context. The destination message becomes the current message in the context.
- To copy and translate all messages from the source to the destination, set the source message number (srcmsg) and the destination message number (destmsg) to VCE_ALL_MESSAGES. This replaces all messages in the destination, not just messages that exist in the source.
- The gain must be in the range of -24 to +24. Otherwise, CTAERR_BAD_ARGUMENT is returned.
- Depending on the type of conversion required, a long message could take many seconds to convert. During this time, the context and the queue that is associated with will be locked. For this reason, you may want to open a separate queue for performing conversions when other Natural Access functions are being used in the same process.
- Converting from one mu-law, A-law, or 8 kHz PCM format to another is relatively fast. Converting between PCM and ADPCM, or converting from one sample rate to another, takes more time.
- The following example shows which conversions are possible and indicates the relative amount of processing required:
Note: kss = kilo-samples/sec (mono or stereo, 8-bit or 16-bit).
See Also
- vceCopyMessage
Example
/* Convert a Wave file of any encoding to a VCE file with NMS encoding */
void myWaveToVce (CTAHD ctahd, char *wavefile, char *vcefile)
{
VCEHD srcvh, destvh;
vceOpenFile (ctahd, wavefile, VCE_FILETYPE_WAVE, VCE_PLAY_ONLY, 0, &srcvh);
vceCreateFile (ctahd, vcefile, VCE_FILETYPE_FLAT,
VCE_ENCODE_NMS_24, NULL, &destvh);
vceConvertMessage (srcvh, 0, destvh, 0, 0);
vceClose (srcvh);
vceClose (destvh);
}
(Page 5 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.