Tao.Sdl SDK Documentation

SdlMixer.Mix_SetMusicPosition Method 

Set position of playback in stream.

[Visual Basic]
Public Shared Function Mix_SetMusicPosition( _
   ByVal position As Double _
) As Integer
[C#]
public static int Mix_SetMusicPosition(
   double position
);

Parameters

position
Position to play from.

Return Value

0 on success, or -1 if the codec doesn't support this function.

Remarks

Set the position of the currently playing music. The position takes different meanings for different music sources. It only works on the music sources listed below.

            MOD
            The double is cast to Uint16 and used for a pattern number in the module.
            Passing zero is similar to rewinding the song.
            OGG
            Jumps to position seconds from the beginning of the song.
            MP3
            Jumps to position seconds from the current position in the stream.
            
So you may want to call Mix_RewindMusic before this. Does not go in reverse...negative values do nothing.

Binds to C-function in SDL_mixer.h

int Mix_SetMusicPosition(double position)
            

Example

            // skip one minute into the song, from the start
            // this assumes you are playing an MP3
                    Mix_RewindMusic();
                    if(Mix_SetMusicPosition(60.0)==-1)
                {
                    printf("Mix_SetMusicPosition: %s\n", Mix_GetError());
                }
            

See Also

SdlMixer Class | Tao.Sdl Namespace | Mix_FadeInMusicPos