music

void kn::music::load(const std::string &fileDir)

Loads a music file.

Parameters:

fileDir – The directory of the music file.

void kn::music::unload()

Unloads the currently loaded music file.

void kn::music::play(int loops = 0, int fadeMs = 0)

Plays the currently loaded music file.

Parameters:
  • loops – The number of times to loop the music. -1 loops forever.

  • fadeMs – The number of milliseconds to fade in the music.

void kn::music::rewind()

Rewinds the currently loaded music file back to the start.

void kn::music::stop()

Stops the currently loaded music file.

void kn::music::pause()

Pauses the currently loaded music file.

void kn::music::resume()

Resumes the currently loaded music file.

void kn::music::fadeOut(int fadeMs)

Fades out the currently loaded music file to the a stop.

Parameters:

fadeMs – The number of milliseconds to fade out the music.

void kn::music::setVolume(float volume)

Sets the volume of the currently loaded music file.

Parameters:

volume – The volume to set the music to. 0.0f is silent, 1.0f is full volume.

float kn::music::getVolume()

Gets the volume of the currently loaded music file.

Returns:

The volume of the currently loaded music file.