AudioPlayer Documentation

In this section you will find all the information you will ever need to use the Code4Fun's AudioPlayer Java Class.

Quick How-To

  1. Import AudioPlayer class with the usual syntax:

    • import org.code4fun.AudioPlayer;
  2. Build a new AudioPlayer object using default constructor:

    • AudioPlayer ap = new AudioPlayer()
  3. Load a sound file, if loading success play the file otherwise print error on the console:

    • if (ap.init("file-path string")) ap.play();
      else System.out.print(ap.error);

Check the AudioPlayer API Documentation (also present in the package) for further details.

AudioPlayer Demo

The AudioPlayer archive includes the source code, the class file, the JavaDoc API and a simple demo player (with source code) to show AudioPlayer class at work.

To run the demo you need J2SE (v.1.5 or better) installed on your system.

The jar demo file is self executable if you have the right file association. Otherwise it can be launched manually by typing java -jar demoplayer.jar on the console.

[Back to Top]