gamingtools
Interface Audio

All Superinterfaces:
AudioClip

public interface Audio
extends AudioClip

The Audio interface is a simple abstraction for playing music or a sound effect. When this object is no longer needed, the dispose() method should be invoked.


Method Summary
 void clearAudioListener()
          Unregisters the AudioListener if there is one.
 void dispose()
          Releases any system resources used by this object.
 void setAudioListener(AudioListener audioListener)
          Registers an AudioListener with this Audio object to receive notification of when the audio stops.
 
Methods inherited from interface java.applet.AudioClip
loop, play, stop
 

Method Detail

setAudioListener

public void setAudioListener(AudioListener audioListener)
Registers an AudioListener with this Audio object to receive notification of when the audio stops.

Parameters:
audioListener - Called back when the audio stops.

clearAudioListener

public void clearAudioListener()
Unregisters the AudioListener if there is one. This method is equivalent to passing null to setAudioListener().


dispose

public void dispose()

Releases any system resources used by this object. An Audio object cannot be used after calling this method.

The finalization process of the garbage collector also disposes of the same system resources; however, since the finalization process may not run to completion for a long duration, it is preferable to manually free the resources by invoking this method.