< Development‎ | Tutorials
Revision as of 11:56, 13 February 2009 by Dridk (talk | contribs)


KALEngine tutorial
Tutorial Series   KALEngine developement
Prerequisites   None
What's Next   Nothing at the moment
Further Reading   KGLEngine2d's code


Phonon is not really designed to handle multiple sounds at the same time. KALEngine is made for games and create one thread per sound, using the excellent openAL librairy. you also get all the other openAL goodness like 3D sounds, effects and multichannel.


1: Be sure you have installed dependent librairy. - openAL ( sound api) - alut (openal toolkit) - libSndFile (load sound file).

2: compile and install kalengine from svn : /trunk/playground/games/KALEngine/

Hello Word

  1. include <KALEngine>
  2. include <KALSource>
  3. include <KDebug>

int main(int argc, char **argv) {

   KALEngine snd; //create an openAL object
   snd.init(); // Initialize OpenAL Context + Device!
   KALSource *son = new KALSource(); // create a sample, if no argument, It will play an "hello world"
   son->play(); // play the sound!!

   while (son->getStatus() == AL_PLAYING) // wait while sound is playing
     kDebug()<<son->getElapsedTime(); //print the elapsed time.

   delete son; //when it finished! Don't forget to clear the buffer!!
   snd.shutdown(); // and close the device!!

   return 0;


Content is available under Creative Commons License SA 4.0 unless otherwise noted.