Adding Sound Libraries

From Jig

Jump to: navigation, search

JIG has support for playing .wav files built right into the engine, but you may want to play other sound file such as .ogg files or the popular .mp3 format. To use these sound files in JIG, you will need to download the correct library and add it to your project.

Adding OGG Support

  1. Download the JIG External Libraries file from the Downloads page.
  2. Open up your project in Eclipse or Netbeans
  3. Add the following jars just like you did the JIG jar
    1. All JARs in the spi/ folder of the external libraries you downloaded
    2. All JARs in the ogg-spi/ folder of the external libraries you downloaded

Adding MP3 Support

  1. Download the JIG External Libraries file from the Downloads page.
  2. Download the MP3 SPI Libraries Here.
  3. Open up your project in Eclipse or Netbeans
  4. Add the following jars just like you did the JIG jar
    1. All JARs in the spi/ folder of the external libraries you downloaded
    2. All JARs in the lib/ folder of the MP3 SPI libraries you downloaded

Playing the Sound Files

You can now play ogg or mp3 files with code similar to what is below.

	private AudioStream music;

	...
	music = new AudioStream(RSC_PATH + "myMusic.ogg");
	music.play(.3);
	...
Personal tools