GF4J 0.9.4 Beta

gameframe.sound
Interface Sound

All Known Subinterfaces:
Music, Sample

public interface Sound

Defines the base interface for all representations of a sound. Offers methods for controlling the playback of a sound.

Since:
GameFrame for Java 0.9.2
Version:
GameFrame for Java 0.9.4

Method Summary
 void finalize()
          Frees all the resources that are used by the sound representation.
 boolean isPlaying()
          Returns true if play() or playLooped() has been invoked on the sound and the stop() hasn't been called after that.
 void playLooped()
          Plays the sound over and over again (looping).
 void playOnce()
          Plays the sound once and then stops.
 void stop()
          Stops playing the sound.
 

Method Detail

playOnce

public void playOnce()
Plays the sound once and then stops. If the sound is already playing then it is stopped and restarted.
Since:
GameFrame for Java 0.9.2

playLooped

public void playLooped()
Plays the sound over and over again (looping). If the sound is already playing then it is stopped and restarted.
Since:
GameFrame for Java 0.9.2

stop

public void stop()
Stops playing the sound.
Since:
GameFrame for Java 0.9.2

isPlaying

public boolean isPlaying()
Returns true if play() or playLooped() has been invoked on the sound and the stop() hasn't been called after that. This method doesn't reflect the fact if the sound can be heard or not at the moment.
Since:
GameFrame for Java 0.9.2

finalize

public void finalize()
Frees all the resources that are used by the sound representation. This method is quite slow to execute and should preferrably be called upon exiting the game or between level changes etc.
Overrides:
finalize in class java.lang.Object
Since:
GameFrame for Java 0.9.2

GF4J 0.9.4 Beta