Package net.sf.freecol.client.gui.sound

This package contains the classes for handling sfx/music in FreeCol.

See:
          Description

Class Summary
Playlist Represent a set of sounds that will be presented to a SoundPlayer in a certain order as defined by the Playlists playmodes.
SoundPlayer Stripped down class for playing sound.
 

Package net.sf.freecol.client.gui.sound Description

This package contains the classes for handling sfx/music in FreeCol. FreeCol initializes the libraries and Canvas initializes the players. Pointers to the library-objects and player-objects are stored in most of the GUI-classes.

This is the method for playing sounds (provided you have got access to the pointers):

        if (sfxPlayer != null) {
            sfxPlayer.play(sfxLibrary.get(sfxLibrary.ILLEGAL_MOVE));
        }
        
        if (musicPlayer != null) {
            musicPlayer.play(musicLibrary.get(musicLibrary.INTRO));
        }

Notice the if-statement checking wether or not the sfxPlayer-object is null. Beeing null indicates that sound is disabled.