Tao.Sdl SDK Documentation

SdlMixer.Mix_FadeOutMusic Method 

Stop music, with fade out

[Visual Basic]
Public Shared Function Mix_FadeOutMusic( _
   ByVal ms As Integer _
) As Integer
[C#]
public static int Mix_FadeOutMusic(
   int ms
);

Parameters

ms
Milliseconds of time that the fade-out effect should take to go to silence, starting now.

Return Value

1 on success, 0 on failure.

Remarks

Gradually fade out the music over ms milliseconds starting from now. The music will be halted after the fade out is completed. Only when music is playing and not fading already are set to fade out, including paused channels. Any callback set by Mix_HookMusicFinished will be called when the music finishes fading out.

Binds to C-function in SDL_mixer.h

int Mix_FadeOutMusic(int ms)
            

Example

            // fade out music to finish 3 seconds from now
                    while(!Mix_FadeOutMusic(3000) && Mix_PlayingMusic())
                {
                    // wait for any fades to complete
                    SDL_Delay(100);
                }
            

See Also

SdlMixer Class | Tao.Sdl Namespace | Mix_HaltMusic | Mix_FadingMusic | Mix_PlayingMusic | Mix_HookMusicFinished