Tao.Sdl SDK Documentation

SdlMixer.Mix_VolumeChunk Method 

Set mix volume

[Visual Basic]
Public Shared Function Mix_VolumeChunk( _
   ByVal chunk As IntPtr, _
   ByVal volume As Integer _
) As Integer
[C#]
public static int Mix_VolumeChunk(
   IntPtr chunk,
   int volume
);

Parameters

chunk
Pointer to the Mix_Chunk to set the volume in.
volume
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.

Return Value

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

Remarks

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

Binds to C-function in SDL_mixer.h

int Mix_VolumeChunk(Mix_Chunk *chunk, int volume)
            

Example

            // 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

SdlMixer Class | Tao.Sdl Namespace | SdlMixer.Mix_Chunk