Method SDL.Music()->fade_in()


Method fade_in

object fade_in(int ms, int|void loops)

Description

Fades the music in over the given number of milliseconds. Playback is repeated loops number of times.

The fade-in will only happen on the first play, not on subsequent loops. Likewise, calling this method on an object that is already playing has the same effect as rewind(): playback will start over at the beginning but without fading in.

Parameter ms

Music fades in over this number of milliseconds.

Parameter loops

How many times the music should be repeated (looped). Passing a value of 0 here means the music plays once over - i.e. no repeats. A value of -1 loops the music indefinitely. This is the default if you don't specify a value.

Returns

The SDL.Music object.

See also

fade_out(), fading()