A Basic OpenAL Sample

I've just created and uploaded a basic OpenAL sample. It plays a sound (it was supposed to be a c-major chord, but what I ended up with works better, explanation below) that moves in a spiral around the listener's head, in a counterclockwise direction. It is commented more than the actual sourcecode, as it is intended for someone new to the technology to follow.

See the readme for directions, and beware for it may fail for mysterious reasons. It shouldn't, but may. I am not responsible for any failures, damages, or the like in any way, sorry. In all seriousness, the chances of this actually breaking something are very, very slim, but you have been warned--it's sad that we have to put this disclaimer on word processors, to be honest, but there you have it.

OpenAlSoft is LGPL. I'm placing this code in the public domain, because it's not really production quality and is basically pointless.

Link: here

And a quick explanation of why normal sounds sound better, at least as I understand it: the hrtf data sets work by convolving two signals. This basically means that hrtfs cleverly modify the component frequencies. You'll be almost entirely unable to notice it with a pure sine wave, as that has only one component frequency and basically overwhelms everything else, but real sounds have hundreds of component frequencies; basic synthesized speech starts with 8 and 39 additional parameters, for example, and real-world sounds have a whole lot more than that.

I do not intend to support this. If there's demand, I might update it and get it working better, but I do not intend to support this. It has no abstraction and is basically an ugly let's learn the technology hack. Half of it should be abstracted out into helper functions at the least, and I will have to wrap most of that functionality in a sound class of some sort. If you get use out of it that's great, but I have no plans to update this.

Comments