This package contains the classes for handling sfx/music in FreeCol. {@link net.sf.freecol.FreeCol} initializes the libraries and {@link net.sf.freecol.client.gui.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.