Main.SideBar (edit) |
Main /
Audioboson uses OpenAL for audio, see www.openal.org OpenAL is a 3d sound library which is in particular useful for 3d games. The OpenAL library from now on replaces the arts/kdemultimedia dependancy completely (and therefore removes all of our arts problems at once). A few problems have come up with OpenAL until now:
boson uses a separate process for audio playing - the bosonaudioprocess (see code/bosound). This adds additional problems, especially concerning latency, the reason for this design comes from the old arts code. Arts is really evil and there was no other way to make sound work. Since arts is not used anymore, the bosonaudioprocess may vanish once someone has some time to do that. There are two different audio parts in boson - music and sound. Music is pretty easy - you load exactly one file, play it exactly once and once it stops you load another file (as a special case the next file may be the same that was loaded before). The interesting part with music playing is at a higher level (which music should when be played; volume; looping; ...) but the actual audio code is pretty simple. The Sound part on the other hand is not so easy and is a lot more important.
All of this is possible and actually even very easy using OpenAL (once again a sidenote from an arts hater: most of this is impossible using arts). A BosonSound object is created for every species in the game. A BosonSound Object is primarily a collection of sound IDs. Such IDs can be
Every ID references a sound. Note that sometimes an ID can reference a list of sounds, i.e. several alternative sound files for the same event. In boson every sound file is currently represented by exactly one BoPlayObject object. These objects originally came from the implementation using arts and they will probably stay as they are pretty useful. In the OpenAL notation a BoPlayObject is exactly one buffer. Therefore every BoPlayObject can be referenced by none or by multiple sources. Note that the current implementation differs from this (as of 04/3/15) as there is always exactly one source for every BoPlayObject - this _will_ change. |