Pike v8.1 release 6

Class SDL.Music

Description

Use an SDL.Music object to load in a music file or sample and then play it back using an internal player.

You must call SDL.init() with the SDL.INIT_AUDIO flag for audio support to be available. You must also first set up some audio parameters with a call to SDL.open_audio().

See also

SDL.open_audio()


Method create

SDL.Music SDL.Music(string fname)

Description

Loads in the given music file and initializes the object ready for playback.

Supported formats are OGG, MP3, MOD, MID and WAV.

An exception is thrown if the file fails to load.

Parameter fname

The name of the music file to be loaded.