Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of ~archive/SoundEngine


Ignore:
Timestamp:
Oct 1, 2007, 8:38:35 PM (17 years ago)
Author:
bknecht
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ~archive/SoundEngine

    v1 v1  
     1= SoundEngine =
     2{{{
     3#!html
     4<div style="border:1px outset #8c5b00;padding: 0.5em 1em 0.5em 1em;background: #ffe17b;-moz-border-radius:10px"><table style="width:100%"><tr><td align="left">
     5}}}
     6[[Image(icons:archive.png, 50)]]
     7{{{
     8#!html
     9</td><td align="center"><b>This is an archived page!</b><br/>This page is very old and the content is not up to date.<br/>Not everything (if any) which is written here will be in the final game!</td><td align="right">
     10}}}
     11[[Image(icons:archive.png, 50)]]
     12{{{
     13#!html
     14</td></tr></table></div>
     15}}}
     16
     17This is the Core of the sound and music in orxonox.
     18
     19== library ==
     20First of all: We use [http://www.openal.org openAL] for rendering of Music and Sound. This is because first of all it suits our framework the best (eg. PNode) and secondly because it is the only usefull 3D-sound-Engine that is cross-platform compatible
     21
     22== usage ==
     23openAL is very easy to use, and the interface is even easier
     24
     25Orxonox-SoundEngine-openAL has three classes:
     26  * SoundBuffers: Buffers that alocate the memory for playing sound. (they only hold the data, but cannot play)
     27  * SoundSources: Play the Buffers at a certain position
     28  * Listeners: Listen to the music from some position (usually camera)
     29
     30Now orxonox implements initialisation of the SoundEngine for itself, so you do not have to worry about it. But there are some interessting functions in it:
     31{{{
     32  SoundSource* createSource(const char* fileName, PNode* sourceNode);
     33}}}
     34
     35used like this:
     36
     37{{{
     38SoundSource* testSound = SoundEngine::getInstance()->createSource("sound/somesound.wav", this->localPlayer);
     39}}}
     40this automatically binds the Buffer read in from "sound/somesond.wav" onto the localPlayer
     41
     42alternatively do something like:
     43{{{
     44SoundBuffer* newBuf = (SoundBuffer*)ResourceManager::getInstance()->load("file.wav", WAV);
     45SoundSource* source = (newBuf, this->localPlayer);
     46}}}
     47this does the same thing, but is not really used, because one can flush the Buffers via the SoundEngine.
     48
     49== SoundSources ==
     50important functions for SoundSources
     51{{{
     52  void play();
     53  void stop();
     54  void pause();
     55  void rewind();
     56}}}
     57
     58less important, but not to forget:
     59{{{
     60void setRolloffFactor(ALfloat rolloffFactor);
     61}}}
     62
     63And thats about it.