SDL_image 1.2.4: Mix_VolumeMusic

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

### 4.5.7 Mix_VolumeMusic

`int Mix_VolumeMusic(int volume)`

volume
  Music volume, from 0 to MIX_MAX_VOLUME(128).
  Values greater than MIX_MAX_VOLUME will use MIX_MAX_VOLUME.
  -1 does not set the volume, but does return the current volume setting.

Set the volume to volume, if it is 0 or greater, and return the previous volume setting. Setting the volume during a fade will not work, the faders use this function to perform their effect! Setting volume while using an external music player set by `Mix_SetMusicCMD` will have no effect, and `Mix_GetError` will show the reason why not.

Returns: The previous volume setting.

    // set the music volume to 1/2 maximum, and then check it
    printf("volume was    : %d\n", Mix_VolumeMusic(MIX_MAX_VOLUME/2));
    printf("volume is now : %d\n", Mix_VolumeMusic(-1));

See Also:
4.5.4 Mix_FadeInMusic, 4.5.14 Mix_FadeOutMusic, 4.5.12 Mix_SetMusicCMD

This document was generated on November, 1 2002 using texi2html