(Page 34 of 41 in this chapter) Version
vceSetPlayGain
Description
- Set the current play gain to a specified amount.
Prototype
- DWORD vceSetPlayGain ( CTAHD ctahd,
int db)
- ctahd Handle returned by ctaCreateContext.
- db The new gain, in decibels.
Return Values
Events
Details
- This function changes the volume (loudness) of message playback by adjusting the amplification, or gain, applied to the message being played.
- The change in volume is expressed in dB units. Positive values represent amplification and negative values represent attenuation. A gain of zero (0) dB provides no amplification or attenuation. A change of one db is approximately the smallest change in volume discernible by the human ear.
- The new gain is stored in the current context identified by ctahd. If play is currently active, the change takes effect immediately. To start the next play with the current gain, set the play gain parameter on the next play to VCE_CURRENT_VALUE.
- Use vceGetContextInfo to get the current value.
See Also
- vceGetContextInfo
, vceSetPlaySpeed
Example
/*
* Sample to adjust play gain by a specific amount. If play is currently
* active, the change takes effect immediately. Otherwise, the change takes
* effect if play is started with the `gain' parameter set to
* VCE_CURRENT_VALUE.
*/
void myAdjustGain(CTAHD ctahd, int change)
{
VCE_CONTEXT_INFO contextinfo;
int dB;
vceGetContextInfo(ctahd, &contextinfo, sizeof contextinfo) ;
dB = contextinfo.currentgain + change;
vceSetPlayGain(ctahd, dB);
}
(Page 34 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.