Skip to content

Audio API

Sven Arends edited this page Aug 3, 2016 · 1 revision

#Audio API Sound sample = new Sound(String path);

  • Create a new Sound

The following methods could be called on a 'Sound'

.play()

  • Play the Sound.
  • Usage: sample.play();

.loop()

  • Play the Sound forever (until .stop() is called).
  • Usage: sample.loop();

.loop(int count)

  • Play the Sound for 'count' times.
  • Usage: sample.loop(10);

.stop()

  • Stop the Sound.
  • Usage: sample.stop();

.isPlaying()

  • Return type: boolean
  • If the Sound is playing it returns 'true'
  • If the sound is not playing it returns 'false'
  • Usage: if (sample.isPlaying) {}
Clone this wiki locally