[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.7 Mix_VolumeChunk

int Mix_VolumeChunk(Mix_Chunk *chunk, int volume)

Pointer to the Mix_Chunk to set the volume in.
The volume to use from 0 to MIX_MAX_VOLUME(128).
If greater than MIX_MAX_VOLUME,
then it will be set to MIX_MAX_VOLUME.
If less than 0 then chunk->volume will not be set.

Set chunk->volume to volume.
The volume setting will take effect when the chunk is used on a channel, being mixed into the output.

Returns: previous chunk->volume setting. if you passed a negative value for volume then this volume is still the current volume for the chunk.

// set the sample's volume to 1/2
// Mix_Chunk *sample;
int previous_volume;
previous_volume=Mix_VolumeChunk(sample, MIX_MAX_VOLUME/2);
printf("previous_volume: %d\n", previous_volume);

See Also:
5.1 Mix_Chunk

This document was generated on November, 13 2009 using texi2html