So, while working on MERCury, I decided I need to move to a better sound system than TinySound. I decided to use pualscode’s 3d sound system (it can be 2d!). But since it is an engine, I need to wrap around it with an class: Sound. So I initialized the sound system successfully:
Starting up SoundSystem...
Initializing LWJGL OpenAL
(The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
OpenAL initialized.
Then I make a sound:
Sound s = Sound.loadSound("res/j.ogg", false, 0, 0);
s.play();
Sound’s load() and play() methods:
public void play() {
Runner.getInstance().soundSystem().play(source);
}
public static Sound loadSound(String location, boolean loop, float x, float y) throws FileNotFoundException {
if (!new File(location).exists())
throw new FileNotFoundException("No '" + location + "' exists!");
try {
Runner.getInstance().soundSystem().loadSound(new URL(location), String.valueOf(Sound.crnt_src));
} catch (MalformedURLException e) {
e.printStackTrace();
}
Sound result = new Sound(String.valueOf(crnt_src));
crnt_src++;
return result;
}
I probably am doing something super n00bish… I am new completely to sound. What little experience I do have is from slick2d, and that has nothing to do with this!
Thanks!