Index: /orxonox/branches/openAL/src/lib/sound/sound_engine.cc
===================================================================
--- /orxonox/branches/openAL/src/lib/sound/sound_engine.cc	(revision 4202)
+++ /orxonox/branches/openAL/src/lib/sound/sound_engine.cc	(revision 4203)
@@ -12,4 +12,7 @@
    main-programmer: Benjamin Grauer
    co-programmer: ...
+
+   code has been taken from http://www.devmaster.net/articles.php?catID=6
+   The code has been applied to our needs, and many things have been changed.
 */
 
@@ -20,4 +23,5 @@
 #include "p_node.h"
 #include "list.h"
+#include "AL/alc.h"
 
 using namespace std;
@@ -38,9 +42,26 @@
   ALvoid* data;
   ALsizei freq;
-
+  
+  ALenum result;
+
+  // generate a Buffer
   alGenBuffers(1, &this->bufferID);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+
+  // read in the wav data
   alutLoadWAVFile((ALbyte*)fileName, &format, &data, &this->size, &freq, &this->loop);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+  
+  // send the loaded wav data to the buffer
   alBufferData(this->bufferID, format, data, this->size, freq);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
+
+  // remove the wav data (redundant)
   alutUnloadWAV(format, data, this->size, freq);
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
 }
 
@@ -59,4 +80,7 @@
 SoundSource::SoundSource(SoundBuffer* buffer, PNode* sourceNode)
 {
+  ALenum result;
+
+  // adding the Source to the SourcesList of the SoundEngine
   SoundEngine::getInstance()->addSource(this);
 
@@ -65,13 +89,9 @@
 
   alGenSources(1, &this->sourceID);
-
-  if(alGetError() != AL_NO_ERROR)
-    PRINTF(1)("error initializing SoundSource\n"); //return AL_FALSE;
-  
+  if ((result = alGetError()) != AL_NO_ERROR)
+    SoundEngine::PrintALErrorString(result);
   alSourcei (this->sourceID, AL_BUFFER,   this->buffer->getID());
   alSourcef (this->sourceID, AL_PITCH,    1.0      );
   alSourcef (this->sourceID, AL_GAIN,     1.0      );
-  //  alSourcefv(sourceID, AL_POSITION, SourcePos);
-  //  alSourcefv(sourceID, AL_VELOCITY, SourceVel);
   alSourcei (sourceID, AL_LOOPING,  true     );
 }
@@ -230,2 +250,62 @@
 }
 
+void SoundEngine::PrintALErrorString(ALenum err)
+{
+  switch(err)
+    {
+    case AL_NO_ERROR:
+      PRINTF(4)("AL_NO_ERROR\n");
+      break;
+      
+    case AL_INVALID_NAME:
+      PRINTF(2)("AL_INVALID_NAME\n");
+      break;
+
+    case AL_INVALID_ENUM:
+      PRINTF(2)("AL_INVALID_ENUM\n");
+      break;
+
+    case AL_INVALID_VALUE:
+      PRINTF(2)("AL_INVALID_VALUE\n");
+      break;
+
+    case AL_INVALID_OPERATION:
+      PRINTF(2)("AL_INVALID_OPERATION\n");
+      break;
+
+    case AL_OUT_OF_MEMORY:
+      PRINTF(2)("AL_OUT_OF_MEMORY\n");
+      break;
+    };
+}
+
+
+void SoundEngine::PrintALCErrorString(ALenum err)
+{
+  switch(err)
+    {
+    case ALC_NO_ERROR:
+      PRINTF(4)("AL_NO_ERROR\n");
+      break;
+
+    case ALC_INVALID_DEVICE:
+      PRINTF(2)("ALC_INVALID_DEVICE\n");
+      break;
+
+    case ALC_INVALID_CONTEXT:
+      PRINTF(2)("ALC_INVALID_CONTEXT\n");
+      break;
+
+    case ALC_INVALID_ENUM:
+      PRINTF(2)("ALC_INVALID_ENUM\n");
+      break;
+
+    case ALC_INVALID_VALUE:
+      PRINTF(2)("ALC_INVALID_VALUE\n");
+      break;
+
+    case ALC_OUT_OF_MEMORY:
+      PRINTF(2)("ALC_OUT_OF_MEMORY\n");
+      break;
+    };
+}
Index: /orxonox/branches/openAL/src/lib/sound/sound_engine.h
===================================================================
--- /orxonox/branches/openAL/src/lib/sound/sound_engine.h	(revision 4202)
+++ /orxonox/branches/openAL/src/lib/sound/sound_engine.h	(revision 4203)
@@ -12,5 +12,5 @@
 
 
-#define SOUND_DOPPLER_FACTOR     0.1
+#define SOUND_DOPPLER_FACTOR     0.01
 #define SOUND_DOPPLER_VELOCITY   500000000
 
@@ -81,4 +81,9 @@
   void update(void);
 
+
+  // error handling:
+  static void PrintALErrorString(ALenum err);
+  static void PrintALCErrorString(ALenum err);
+
  private:
   SoundEngine(void);
