kripken/emscripten — pull request #1136 by inolen (2013-05-04 07:07:23+00:00)
Title: OpenAL: buffer queuing and more

This changelist contains multiple additions / fixes to the OpenAL lib, namely:

- Added support for alSourceQueueBuffers / alSourceUnqueueBuffers
- 8-bit PCM data is now treated as unsigned.
- GetLastError now clears last error when called.
- Added support for AL_SOURCE_RELATIVE (to toggle between using positional audio).
- Added getter / setter support for panner properties (e.g. AL_ROLLOFF_FACTOR)
- Added setting of error codes to many of the al* functions (I definitely didn't go through and set _every_ error code correctly, it was a bit ad-hoc)
- Added in constants from AL.h
- Added basic test case for buffer queuing

To note, the alSourceQueueBuffers support still has some issues. The general idea is that now upon calling alcCreateContext and interval is started that is responsible for queuing up buffers, setting source state (stopped, playing, etc.). This works, and according to the timing information I've looked at everything is correct. However, for small buffer sizes I'm getting some odd popping noise between buffers and I'm out of ideas as to what it is.

However, I'd say it's working reasonably well as is and much better than nothing :) The only times where I'm noticing the popping is during cinematic scenes for example where quake3 is queuing individual frames of audio data.