Appendix 2: Playing sounds

Env3D has the ability to play sound files in the .wav and the .ogg formats. Follow these simple instructions to play a sound file:

  1. Place all your sound files into the "sounds/" directory inside your project.
  2. Assuming that you have created the env object:
    • env.soundPlay() method will play a short sound file (small size). The parameter is the filename of your sound file.  You cannot stop this sound from playing.
    • env.soundLoop() method will play a long sound file continuously (large size).
    • env.soundStop() will stop a looping sound file.
  3. There are various soundPlay() methods for 3D sound placement.  Please check out the javadoc for the Env class for details.