ALU
Ed <[email protected]>
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <[email protected]> |
A couple of years ago I was involved in working on the audio engine
for a free game. I posted a couple of naive questions here about AL
contexts. Anyway to cut a long story short, I ended up writing most of
a transparent layer over AL which I called ALU which implemented some
of the features I needed that are not present in AL. I see that
OpenALSoft and ALURE have some similar functionality that has come out
in the meantime. I just dug this up off my hard drive and I'm
wondering if there's interest in this library. If there is, I'll try
to finish it off and release it somewhere. The key features it adds
are:
GL interoperability - it basically replicates most of the gl matrix
operations and applies them to its own internal 4x4 transform matrix.
It accepts the same formats as GL so you can simply load in your
current modelview matrix from GL, if you so desire.
Automatic doppler - it interposes itself between you and the source,
and updates its velocity based on the position increments (you have to
specify how much time has elapsed globally).
Streaming - a fairly simple pure streaming interface where you poll
for buffer debt (rather than callbacks as in ALURE) and queue the
required number.
Scoping - the hardest part and currently unfinished. This undertakes
to give you separate sound scopes in which your sources are unique
within scope and not between scope. Only one scope is active at a
time. It interacts with all the other ALU features and almost
everything in AL to provide transparent context switches. This is not
totally possible in AL because of extensions - there's no way to
save/restore all extension states without knowing about them as far as
I recall. However, for some purposes it's good enough. If this is ever
added to the AL spec it would be possible.
The following specs give an idea of the size of the library, but are
uncommented at present (I need to dig through my sources to find the
descriptions - the library was not obviously ready for release).
GL interop -
void aluPushMatrix(void);
void aluPopMatrix(void);
void aluLoadMatrixf(const ALfloat* mat);
void aluLoadMatrixd(const ALdouble* mat);
void aluMultMatrixf(const ALfloat* mat);
void aluMultMatrixd(const ALdouble* mat);
void aluLoadIdentity();
void aluRotatef(ALfloat angle, ALfloat x, ALfloat y, ALfloat z);
void aluRotated(ALdouble angle, ALdouble x, ALdouble y, ALdouble z);
void aluTranslatef(ALfloat x, ALfloat y, ALfloat z);
void aluTranslated(ALdouble x, ALdouble y, ALdouble z);
void aluScalef(ALfloat x, ALfloat y, ALfloat z);
void aluScaled(ALdouble x, ALdouble y, ALdouble z);
Source automatic velocity from motion (i.e. as you move it it updates
velocities for doppler):
void aluSourcefv(ALuint source, ALUenum key, ALfloat *params);
void aluSource3f(ALuint source, ALUenum key, ALfloat x, ALfloat y, ALfloat z);
void aluListenerfv(ALUenum key, ALfloat *params);
void aluListener3f(ALUenum key, ALfloat x, ALfloat y, ALfloat z);
void aluListener6f(ALUenum key,
ALfloat atx, ALfloat aty, ALfloat atz,
ALfloat upx, ALfloat upy, ALfloat upz);
void aluInterpolationPeriodf(float period);
void aluInterpolationPeriodd(double period);
void aluInterpolationMode(ALUenum mode);
Streaming through buffers:
void aluSourceStream(ALuint source, ALuint num_buffers, ALuint *buffers);
void aluSourceUnstream(ALuint source);
void aluGetSourceStreami(ALuint source, ALUenum key, ALuint *param);
void aluGetSourceStreamBuffers(ALuint source, ALuint num_buffers,
ALuint *n_used, ALuint *buffers);
void aluSourceStreamBufferData(ALuint source, ALenum format,
const ALvoid *data, ALsizei size,
ALsizei freq);
void aluSourceStreamPlay(ALuint source);
void aluSourceStreamPause(ALuint source);
void aluSourceStreamStop(ALuint source);
void aluSourceStreamRelease(ALuint source);
Scoping (that is logically distinct sound scopes):
ALuint aluCreateScope();
void aluDestroyScope(ALuint scope_id);
void aluMakeScopeCurrent(ALuint scope_id);
void aluGenSources(ALuint n, ALuint *names);
int aluIsSource(ALuint n);
void aluDeleteSources(ALUint n, ALUint *names);
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal