#include <cafe/ax.h>

void AXSetVoiceVe(AXVPB *p, const AXPBVE *ve);


p Pointer to the specified voice.
ve Pointer to structure of type AXPBVE. Values are initialized by the user audio application.

Return Values



AXSetVoiceVe sets the volume envelope settings for a voice. The envelope settings consist of a current volume and a volume delta. Set the currentVolume value between 0x0000 (silent) and 0x8000 (full volume).

The value of currentDelta is added to the currentVolume for each audio sample that the voice plays in the next frame. Use this to prevent zipping artifacts when making large volume changes. When ramping the volume of a voice between two values over the course of a single audio frame, set it as follows.

    currentDelta = (TargetVolume - CurrentVolume) / AX_IN_SAMPLES_PER_FRAME

Because of this implementation, there is a limit to the precision with which the voice volume may be changed when using the voice delta alone. To set the volume to the exact target volume, it is recommended that you call AXSetVoiceVe in the next frame.

The currentDelta for a voice continue to be applied to each frame until it is set to 0 with AXSetVoiceVe or AXSetVoiceVeDelta.

To change the volume delta value only, use AXSetVoiceVeDelta.


Library Version Availability
Sound 2.0 Yes
Sound 1.0 Yes

Do Not Call From


See Also


Revision History

2013/10/15 Updated for clarity.
2013/08/30 Edited for clarity.
2013/05/08 Automated cleanup pass.
2012/08/01 Cleanup Pass.
2012/01/26 Update to Audio API v2.0.
2011/02/21 Initial Version