Standard programming mysteries.

I hate it when I’m starting off with an API and the tutorials don’t work.

I was working with the LWJGL OpenAl examples described in earlier posts, and could not get the audio files in the examples to open. The file was there, it could be converted to an InputStream, but when I tried creating a LWJGL WaveData object, the underlying java audio code would throw an error and I’d get a null object.

So since I’m now trying to figure out what gives with the javax.sound.sampled.* system, I might as well see if I can do what I want to do here. So off we go to the Internet once more, looking for examples that work.

The first thing I found was the Oracle Java Sound API documents, which are huge, loaded with theory and very little code. I’m not complaining really, because they look like they will be really useful when I have a little bit of code working. But there needs to be a “Hello, World”.

Which showed up after a bit of searching. There is a website JSResources, put together by two German (?) developers; Florian Bomers and Matthias Pfisterer. It is loaded with examples that seem to work. I’ve just gotten one of their simple examples running with a minimum of fuss. (Here’s the (slightly) modified code).  Since this is straight sound library, we know that we can run all the channels. Now we just need to get from here to there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s