Listing 4

1  public void audioTest() {

2    Audio fightSFX = AudioSource

         .getAudio("fight.wav");

3    fightSFX.setAudioListener(this);

4    fightSFX.play();

5  

6    // wait for it to finish ...

7   

8    fightSFX.dispose();

9  }

10 

11 public void audioStopped() {

12   // notify that sound is done ...

13 }