Index: /code/branches/core5/data/levels/presentation_pong.oxw
===================================================================
--- /code/branches/core5/data/levels/presentation_pong.oxw	(revision 5895)
+++ /code/branches/core5/data/levels/presentation_pong.oxw	(revision 5896)
@@ -46,4 +46,6 @@
  gametype     = Pong
 >
+  <AmbientSound soundFile="ambient/mainmenu.wav" playOnLoad=true />
+
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
@@ -82,4 +84,12 @@
           <ParticleSpawner name=scoreeffect_left position="-120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
           <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
+
+          <WorldSound name="scoreSound" position="0,0,0" soundFile="sounds/pong_score.wav" >
+            <events>
+              <play>
+                <EventListener event=pongcenter />
+              </play>
+            </events>
+          </WorldSound>
 
 <?lua
Index: /code/branches/core5/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- /code/branches/core5/src/orxonox/OrxonoxPrereqs.h	(revision 5895)
+++ /code/branches/core5/src/orxonox/OrxonoxPrereqs.h	(revision 5896)
@@ -150,7 +150,8 @@
 
     //sound
-    class SoundBase;
+    class AmbientSound;
+    class BaseSound;
     class SoundManager;
-    class SoundMainMenu;
+    class WorldSound;
 
     // weaponsystem
Index: /code/branches/core5/src/orxonox/controllers/HumanController.cc
===================================================================
--- /code/branches/core5/src/orxonox/controllers/HumanController.cc	(revision 5895)
+++ /code/branches/core5/src/orxonox/controllers/HumanController.cc	(revision 5896)
@@ -36,4 +36,5 @@
 #include "infos/PlayerInfo.h"
 #include "overlays/Map.h"
+#include "sound/SoundManager.h"
 #include "Radar.h"
 #include "Scene.h"
@@ -77,4 +78,17 @@
     }
 
+    void HumanController::tick(float dt)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+        {
+            if (GameMode::playsSound())
+            {
+                // Update sound listener
+                SoundManager::getInstance().setListenerPosition(HumanController::localController_s->controllableEntity_->getPosition());
+                SoundManager::getInstance().setListenerOrientation(HumanController::localController_s->controllableEntity_->getOrientation());
+            }
+        }
+    }
+
     void HumanController::moveFrontBack(const Vector2& value)
     {
Index: /code/branches/core5/src/orxonox/controllers/HumanController.h
===================================================================
--- /code/branches/core5/src/orxonox/controllers/HumanController.h	(revision 5895)
+++ /code/branches/core5/src/orxonox/controllers/HumanController.h	(revision 5896)
@@ -31,13 +31,17 @@
 
 #include "OrxonoxPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
 #include "Controller.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport HumanController : public Controller
+    class _OrxonoxExport HumanController : public Controller, public Tickable
     {
         public:
             HumanController(BaseObject* creator);
             virtual ~HumanController();
+
+            virtual void tick(float dt);
 
             static void moveFrontBack(const Vector2& value);
Index: /code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- /code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc	(revision 5895)
+++ /code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc	(revision 5896)
@@ -39,5 +39,5 @@
 #include "core/GUIManager.h"
 #include "Scene.h"
-#include "sound/SoundBase.h"
+#include "sound/AmbientSound.h"
 
 namespace orxonox
@@ -62,6 +62,6 @@
         {
             // Load sound
-            this->ambient_ = new SoundBase(0);
-            this->ambient_->loadFile("ambient/mainmenu.wav");
+            this->ambient_ = new AmbientSound(0);
+            this->ambient_->setSoundFile("ambient/mainmenu.wav");
         }
     }
@@ -96,5 +96,6 @@
         if (GameMode::playsSound())
         {
-            this->ambient_->play(true);
+            this->ambient_->setLoop(true);
+            this->ambient_->play();
         }
     }
Index: /code/branches/core5/src/orxonox/gamestates/GSMainMenu.h
===================================================================
--- /code/branches/core5/src/orxonox/gamestates/GSMainMenu.h	(revision 5895)
+++ /code/branches/core5/src/orxonox/gamestates/GSMainMenu.h	(revision 5896)
@@ -59,5 +59,5 @@
 
         // ambient sound for the main menu
-        SoundBase*        ambient_;
+        AmbientSound*     ambient_;
     };
 }
Index: /code/branches/core5/src/orxonox/sound/AmbientSound.cc
===================================================================
--- /code/branches/core5/src/orxonox/sound/AmbientSound.cc	(revision 5896)
+++ /code/branches/core5/src/orxonox/sound/AmbientSound.cc	(revision 5896)
@@ -0,0 +1,61 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "AmbientSound.h"
+
+#include "core/EventIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(AmbientSound);
+
+    AmbientSound::AmbientSound(BaseObject* creator)
+        : BaseObject(creator)
+    {
+        RegisterObject(AmbientSound);
+    }
+
+    AmbientSound::~AmbientSound()
+    {
+    }
+
+    void AmbientSound::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(AmbientSound, XMLPort, xmlelement, mode);
+        XMLPortParamExtern(AmbientSound, BaseSound, this, "soundFile", setSoundFile, getSoundFile, xmlelement, mode);
+        XMLPortParamExtern(AmbientSound, BaseSound, this, "loop", setLoop, getLoop, xmlelement, mode);
+        XMLPortParamExtern(AmbientSound, BaseSound, this, "playOnLoad", setPlayOnLoad, getPlayOnLoad, xmlelement, mode);
+    }
+
+    void AmbientSound::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(AmbientSound, XMLEventPort, xmlelement, mode);
+        XMLPortEventState(AmbientSound, BaseObject, "play", play, xmlelement, mode);
+    }
+}
Index: /code/branches/core5/src/orxonox/sound/AmbientSound.h
===================================================================
--- /code/branches/core5/src/orxonox/sound/AmbientSound.h	(revision 5896)
+++ /code/branches/core5/src/orxonox/sound/AmbientSound.h	(revision 5896)
@@ -0,0 +1,56 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+#ifndef _AmbientSound_H__
+#define _AmbientSound_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/BaseObject.h"
+#include "sound/BaseSound.h"
+
+namespace orxonox
+{
+    /**
+     * The AmbientSound class is the base class for all sound file loader classes.
+     * It server as main interface to the OpenAL library.
+     *
+     */
+    class _OrxonoxExport AmbientSound : public BaseSound, public BaseObject
+    {
+    public:
+        AmbientSound(BaseObject* creator);
+        virtual ~AmbientSound();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+
+    private:
+    };
+}
+
+#endif /* _AmbientSound_H__ */
Index: /code/branches/core5/src/orxonox/sound/BaseSound.cc
===================================================================
--- /code/branches/core5/src/orxonox/sound/BaseSound.cc	(revision 5896)
+++ /code/branches/core5/src/orxonox/sound/BaseSound.cc	(revision 5896)
@@ -0,0 +1,234 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+#include "BaseSound.h"
+
+#include <vector>
+#include <AL/alut.h>
+#include <vorbis/vorbisfile.h>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/Resource.h"
+
+namespace orxonox
+{
+    BaseSound::BaseSound()
+        : source_(0)
+        , buffer_(0)
+        , bPlayOnLoad_(false)
+        , bLoop_(false)
+    {
+        RegisterRootObject(BaseSound);
+    }
+
+    BaseSound::~BaseSound()
+    {
+        this->setSoundFile("");
+    }
+
+    void BaseSound::play()
+    {
+        if (alIsSource(this->source_))
+        {
+            if (this->bLoop_)
+                alSourcei(this->source_, AL_LOOPING, AL_TRUE);
+            else
+                alSourcei(this->source_, AL_LOOPING, AL_FALSE);
+            alSourcePlay(this->source_);
+
+            if (alGetError() != AL_NO_ERROR)
+            {
+                 COUT(2) << "Sound: OpenAL: Error playin sound " << this->source_ << std::endl;
+            }
+        }
+    }
+
+    void BaseSound::stop()
+    {
+        if (alIsSource(this->source_))
+            alSourceStop(this->source_);
+    }
+
+    void BaseSound::pause()
+    {
+        if (alIsSource(this->source_))
+            alSourcePause(this->source_);
+    }
+
+    bool BaseSound::isPlaying()
+    {
+        if (alIsSource(this->source_))
+            return getSourceState() == AL_PLAYING;
+        return false;
+    }
+
+    bool BaseSound::isPaused()
+    {
+        if (alIsSource(this->source_))
+            return getSourceState() == AL_PAUSED;
+        return true;
+    }
+
+    bool BaseSound::isStopped()
+    {
+        if (alIsSource(this->source_))
+            return getSourceState() == AL_INITIAL || getSourceState() == AL_STOPPED;
+        return true;
+    }
+
+    void BaseSound::setPlayOnLoad(bool val)
+    {
+        this->bPlayOnLoad_ = true;
+        this->play();
+    }
+
+    void BaseSound::setSoundFile(const std::string& soundFile)
+    {
+        this->soundFile_ = soundFile;
+        if (!GameMode::playsSound())
+            return;
+
+        if (soundFile.empty() && alIsSource(this->source_))
+        {
+            // Unload sound
+            alSourcei(this->source_, AL_BUFFER, 0);
+            alDeleteSources(1, &this->source_);
+            alDeleteBuffers(1, &this->buffer_);
+            return;
+        }
+
+        COUT(3) << "Sound: OpenAL ALUT: loading file " << soundFile << std::endl;
+        // Get DataStream from the resources
+        shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(soundFile);
+        if (fileInfo == NULL)
+        {
+            COUT(2) << "Warning: Sound file '" << soundFile << "' not found" << std::endl;
+            return;
+        }
+        DataStreamPtr stream = Resource::open(soundFile);
+        // Read everything into a temporary buffer
+        char* buffer = new char[fileInfo->size];
+        stream->read(buffer, fileInfo->size);
+
+        this->buffer_ = alutCreateBufferFromFileImage(buffer, fileInfo->size);
+        delete[] buffer;
+
+        if (this->buffer_ == AL_NONE)
+        {
+            COUT(2) << "Sound: OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
+            return;
+            //if (filename.find("ogg", 0) != std::string::npos)
+            //{
+            //    COUT(2) << "Sound: Trying fallback ogg loader" << std::endl;
+            //    this->buffer_ = loadOggFile(filename);
+            //}
+
+            //if (this->buffer_ == AL_NONE)
+            //{
+            //    COUT(2) << "Sound: fallback ogg loader failed: " << alutGetErrorString(alutGetError()) << std::endl;
+            //    return;
+            //}
+        }
+
+        alGenSources(1, &this->source_);
+        alSourcei(this->source_, AL_BUFFER, this->buffer_);
+        if (alGetError() != AL_NO_ERROR)
+        {
+            COUT(2) << "Sound: OpenAL: Error loading sample file: " << soundFile << std::endl;
+            return;
+        }
+
+        alSource3f(this->source_, AL_POSITION,  0, 0, 0);
+
+        if (this->bPlayOnLoad_)
+            this->play();
+    }
+
+    ALint BaseSound::getSourceState()
+    {
+        ALint state;
+        alGetSourcei(this->source_, AL_SOURCE_STATE, &state);
+        return state;
+    }
+
+#if 0 // Not yet supported because of missing resource implementation
+    ALuint BaseSound::loadOggFile(const std::string& filename)
+    {
+        char inbuffer[4096];
+        std::vector<char> outbuffer;
+        OggVorbis_File vf;
+        vorbis_info* vorbisInfo;
+        int eof = false;
+        int current_section;
+        ALuint buffer;
+        ALenum format;
+
+        FILE* f = fopen(filename.c_str(), "rb");
+
+        if (ov_open(f, &vf, NULL, 0) < 0)
+        {
+            COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;
+            ov_clear(&vf);
+            return AL_NONE;
+        }
+
+        while (!eof)
+        {
+            long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, &current_section);
+            if (ret == 0)
+            {
+                eof = true;
+            }
+            else if (ret < 0)
+            {
+                COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
+                ov_clear(&vf);
+                return AL_NONE;
+            }
+            else
+            {
+                outbuffer.insert(outbuffer.end(), inbuffer, inbuffer + sizeof(inbuffer));
+            }
+        }
+
+        vorbisInfo = ov_info(&vf, -1);
+        if (vorbisInfo->channels == 1)
+            format = AL_FORMAT_MONO16;
+        else
+            format = AL_FORMAT_STEREO16;
+
+        alGenBuffers(1, &buffer);
+        alBufferData(buffer, format, &outbuffer[0], outbuffer.size(), vorbisInfo->rate);
+        ov_clear(&vf);
+
+        return buffer;
+    }
+#endif
+
+} // namespace: orxonox
Index: /code/branches/core5/src/orxonox/sound/BaseSound.h
===================================================================
--- /code/branches/core5/src/orxonox/sound/BaseSound.h	(revision 5896)
+++ /code/branches/core5/src/orxonox/sound/BaseSound.h	(revision 5896)
@@ -0,0 +1,80 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+#ifndef _BaseSound_H__
+#define _BaseSound_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    /**
+     * The BaseSound class is the base class for all sound file loader classes.
+     * It server as main interface to the OpenAL library.
+     *
+     */
+    class _OrxonoxExport BaseSound : virtual public OrxonoxClass
+    {
+    public:
+        BaseSound();
+        virtual ~BaseSound();
+
+        void play();
+        void stop();
+        void pause();
+
+        bool isPlaying();
+        bool isPaused();
+        bool isStopped();
+
+        void setSoundFile(const std::string& soundFile);
+        const std::string& getSoundFile() { return this->soundFile_; }
+
+        bool getPlayOnLoad() { return this->bPlayOnLoad_; }
+        void setPlayOnLoad(bool val);
+
+        bool getLoop() { return this->bLoop_; }
+        void setLoop(bool val) { this->bLoop_ = val; }
+
+    protected:
+        //ALuint loadOggFile(const std::string& filename);
+        ALint getSourceState();
+
+        ALuint source_;
+        ALuint buffer_;
+
+    private:
+        std::string soundFile_;
+        bool bPlayOnLoad_;
+        bool bLoop_;
+    };
+}
+
+#endif /* _BaseSound_H__ */
Index: /code/branches/core5/src/orxonox/sound/CMakeLists.txt
===================================================================
--- /code/branches/core5/src/orxonox/sound/CMakeLists.txt	(revision 5895)
+++ /code/branches/core5/src/orxonox/sound/CMakeLists.txt	(revision 5896)
@@ -1,5 +1,7 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+    AmbientSound.cc
+    BaseSound.cc
     SoundManager.cc
-    SoundBase.cc
+    WorldSound.cc
 )
 
Index: de/branches/core5/src/orxonox/sound/SoundBase.cc
===================================================================
--- /code/branches/core5/src/orxonox/sound/SoundBase.cc	(revision 5895)
+++ 	(revision )
@@ -1,239 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *       Erwin 'vaiursch' Herrsche
- *   Co-authors:
- *      ...
- *
- */
-
-#include "SoundBase.h"
-
-#include <string>
-#include <vector>
-#include <AL/alut.h>
-#include <vorbis/vorbisfile.h>
-
-#include "util/Math.h"
-#include "core/Resource.h"
-#include "worldentities/WorldEntity.h"
-#include "SoundManager.h"
-
-namespace orxonox
-{
-    SoundBase::SoundBase(WorldEntity* entity)
-    {
-        this->source_ = 0;
-        this->buffer_ = 0;
-        this->entity_ = entity;
-
-        SoundManager::getInstance().addSound(this);
-    }
-
-    SoundBase::~SoundBase()
-    {
-        alSourcei(this->source_, AL_BUFFER, 0);
-        alDeleteSources(1, &this->source_);
-        alDeleteBuffers(1, &this->buffer_);
-    }
-
-    void SoundBase::attachToEntity(WorldEntity* entity)
-    {
-        this->entity_ = entity;
-        this->update();
-    }
-
-    void SoundBase::update() {
-        if(this->entity_ != NULL && alIsSource(this->source_)) {
-            const Vector3& pos = this->entity_->getPosition();
-            alSource3f(this->source_, AL_POSITION, pos.x, pos.y, pos.z);
-            ALenum error = alGetError();
-            if(error == AL_INVALID_VALUE)
-                COUT(2) << "Sound: OpenAL: Invalid sound position" << std::endl;
-
-            const Vector3& vel = this->entity_->getVelocity();
-            alSource3f(this->source_, AL_VELOCITY, vel.x, vel.y, vel.z);
-            error = alGetError();
-            if(error == AL_INVALID_VALUE)
-                COUT(2) << "Sound: OpenAL: Invalid sound velocity" << std::endl;
-
-            const Quaternion& orient = this->entity_->getOrientation();
-            Vector3 at = orient.zAxis();
-            alSource3f(this->source_, AL_DIRECTION, at.x, at.y, at.z);
-            error = alGetError();
-            if(error == AL_INVALID_VALUE)
-                COUT(2) << "Sound: OpenAL: Invalid sound direction" << std::endl;
-        }
-    }
-
-    void SoundBase::play(bool loop) {
-        if(alIsSource(this->source_)) {
-            if(loop)
-                alSourcei(this->source_, AL_LOOPING, AL_TRUE);
-            else
-                alSourcei(this->source_, AL_LOOPING, AL_FALSE);
-            alSourcePlay(this->source_);
-
-            if(alGetError() != AL_NO_ERROR)
-            {
-                 COUT(2) << "Sound: OpenAL: Error playin sound " << this->source_ << std::endl;
-            }
-        }
-    }
-
-    void SoundBase::stop() {
-        if(alIsSource(this->source_)) {
-            alSourceStop(this->source_);
-        }
-    }
-
-    void SoundBase::pause() {
-        if(alIsSource(this->source_)) {
-            alSourcePause(this->source_);
-        }
-    }
-
-    bool SoundBase::isPlaying() {
-        if(alIsSource(this->source_)) {
-            return getSourceState() == AL_PLAYING;
-        }
-        return false;
-    }
-
-    bool SoundBase::isPaused() {
-        if(alIsSource(this->source_)) {
-            return getSourceState() == AL_PAUSED;
-        }
-        return true;
-    }
-
-    bool SoundBase::isStopped() {
-        if(alIsSource(this->source_)) {
-            return getSourceState() == AL_INITIAL || getSourceState() == AL_STOPPED;
-        }
-        return true;
-    }
-
-    bool SoundBase::loadFile(const std::string& filename) {
-        if(!SoundManager::getInstance().isSoundAvailable())
-        {
-            COUT(3) << "Sound: not available, skipping " << filename << std::endl;
-            return false;
-        }
-
-        COUT(3) << "Sound: OpenAL ALUT: loading file " << filename << std::endl;
-        // Get DataStream from the resources
-        shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
-        if (fileInfo == NULL) {
-            COUT(2) << "Warning: Sound file '" << filename << "' not found" << std::endl;
-            return false;
-        }
-        DataStreamPtr stream = Resource::open(filename);
-        // Read everything into a temporary buffer
-        char* buffer = new char[fileInfo->size];
-        stream->read(buffer, fileInfo->size);
-
-        this->buffer_ = alutCreateBufferFromFileImage(buffer, fileInfo->size);
-        delete[] buffer;
-
-        if(this->buffer_ == AL_NONE) {
-            COUT(2) << "Sound: OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
-            if(filename.find("ogg", 0) != std::string::npos)
-            {
-                COUT(2) << "Sound: Trying fallback ogg loader" << std::endl;
-                this->buffer_ = loadOggFile(filename);
-            }
-
-            if(this->buffer_ == AL_NONE)
-            {
-                COUT(2) << "Sound: fallback ogg loader failed: " << alutGetErrorString(alutGetError()) << std::endl;
-                return false;
-            }
-        }
-
-        alGenSources(1, &this->source_);
-        alSourcei(this->source_, AL_BUFFER, this->buffer_);
-        if(alGetError() != AL_NO_ERROR) {
-            COUT(2) << "Sound: OpenAL: Error loading sample file: " << filename << std::endl;
-            return false;
-        }
-        return true;
-    }
-
-    ALint SoundBase::getSourceState() {
-        ALint state;
-        alGetSourcei(this->source_, AL_SOURCE_STATE, &state);
-        return state;
-    }
-
-    ALuint SoundBase::loadOggFile(const std::string& filename)
-    {
-        char inbuffer[4096];
-        std::vector<char> outbuffer;
-        OggVorbis_File vf;
-        vorbis_info* vorbisInfo;
-        int eof = false;
-        int current_section;
-        ALuint buffer;
-        ALenum format;
-
-        FILE* f = fopen(filename.c_str(), "rb");
-
-        if(ov_open(f, &vf, NULL, 0) < 0)
-        {
-            COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;
-            ov_clear(&vf);
-            return AL_NONE;
-        }
-
-        while(!eof)
-        {
-            long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, &current_section);
-            if (ret == 0)
-            {
-                eof = true;
-            }
-            else if (ret < 0)
-            {
-                COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
-                ov_clear(&vf);
-                return AL_NONE;
-            }
-            else
-            {
-                outbuffer.insert(outbuffer.end(), inbuffer, inbuffer + sizeof(inbuffer));
-            }
-        }
-
-        vorbisInfo = ov_info(&vf, -1);
-        if(vorbisInfo->channels == 1)
-            format = AL_FORMAT_MONO16;
-        else
-            format = AL_FORMAT_STEREO16;
-
-        alGenBuffers(1, &buffer);
-        alBufferData(buffer, format, &outbuffer[0], outbuffer.size(), vorbisInfo->rate);
-        ov_clear(&vf);
-
-        return buffer;
-    }
-} // namespace: orxonox
Index: de/branches/core5/src/orxonox/sound/SoundBase.h
===================================================================
--- /code/branches/core5/src/orxonox/sound/SoundBase.h	(revision 5895)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *       Erwin 'vaiursch' Herrsche
- *   Co-authors:
- *      ...
- *
- */
-#ifndef _SoundBase_H__
-#define _SoundBase_H__
-
-#include "OrxonoxPrereqs.h"
-#include <cstring> // define NULL
-
-namespace orxonox
-{
-    /**
-     * The SoundBase class is the base class for all sound file loader classes.
-     * It server as main interface to the OpenAL library.
-     *
-     */
-    class _OrxonoxExport SoundBase
-    {
-    public:
-        SoundBase(WorldEntity* entity = NULL);
-        ~SoundBase();
-
-        void attachToEntity(WorldEntity* entity);
-        void update();
-        void play(bool loop = false);
-        void stop();
-        void pause();
-
-        bool isPlaying();
-        bool isPaused();
-        bool isStopped();
-
-        bool loadFile(const std::string& filename);
-
-    private:
-        ALuint loadOggFile(const std::string& filename);
-        ALuint source_;
-        ALuint buffer_;
-        WorldEntity* entity_;
-
-        ALint getSourceState();
-    }; // class SoundBase
-} // namepsace orxonox
-
-#endif /* _SoundBase_H__ */
Index: /code/branches/core5/src/orxonox/sound/SoundManager.cc
===================================================================
--- /code/branches/core5/src/orxonox/sound/SoundManager.cc	(revision 5895)
+++ /code/branches/core5/src/orxonox/sound/SoundManager.cc	(revision 5896)
@@ -36,7 +36,4 @@
 #include "core/GameMode.h"
 #include "core/ScopedSingletonManager.h"
-#include "CameraManager.h"
-#include "graphics/Camera.h"
-#include "SoundBase.h"
 
 namespace orxonox
@@ -89,74 +86,25 @@
     }
 
-    /**
-     * Add a SoundBase object to the list. Every SoundBase object should be in
-     * this list.
-     *
-     * @param sound Pointer to the SoundBase object to add
-     */
-    void SoundManager::addSound(SoundBase* sound)
+    void SoundManager::setListenerPosition(const Vector3& position)
     {
-        this->soundlist_.push_back(sound);
+        alListener3f(AL_POSITION, position.x, position.y, position.z);
+        ALenum error = alGetError();
+        if (error == AL_INVALID_VALUE)
+            COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;
     }
 
-    /**
-     * Remove a SoundBase object from the list and destroy it.
-     */
-    void SoundManager::removeSound(SoundBase* sound)
+    void SoundManager::setListenerOrientation(const Quaternion& orientation)
     {
-        std::list<SoundBase*>::iterator pos = this->soundlist_.end();
-        for(std::list<SoundBase*>::iterator i = this->soundlist_.begin(); i != this->soundlist_.end(); i++)
-        {
-            if((*i) == sound)
-                pos = i;
-        }
+        // update listener orientation
+        Vector3 up = orientation.xAxis(); // just a wild guess
+        Vector3 at = orientation.zAxis();
 
-        delete (*pos);
-        this->soundlist_.erase(pos);
-    }
+        ALfloat orient[6] = { at.x, at.y, at.z,
+                              up.x, up.y, up.z };
 
-    /**
-     * Tick function, updates listener and registred SoundBase objects
-     *
-     * @param dt @see Orxonox::Tickable
-     */
-    void SoundManager::tick(float dt)
-    {
-        if (!CameraManager::getInstancePtr())
-            return;
-
-        // update listener position
-        Camera* camera = CameraManager::getInstance().getActiveCamera();
-        if(camera == NULL) return;
-        Vector3 pos = camera->getPosition();
-        alListener3f(AL_POSITION, pos.x, pos.y, pos.z);
+        alListenerfv(AL_POSITION, orient);
         ALenum error = alGetError();
-        if(error == AL_INVALID_VALUE)
-            COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;
-
-        // update listener orientation
-        const Quaternion& orient = camera->getOrientation();
-        Vector3 up = orient.xAxis(); // just a wild guess
-        Vector3 at = orient.zAxis();
-
-        ALfloat orientation[6] = { at.x, at.y, at.z,
-                                 up.x, up.y, up.z };
-
-        alListenerfv(AL_POSITION, orientation);
-        error = alGetError();
-        if(error == AL_INVALID_VALUE)
+        if (error == AL_INVALID_VALUE)
             COUT(2) << "Sound: OpenAL: Invalid listener orientation" << std::endl;
-
-        // update sounds
-        for(std::list<SoundBase*>::iterator i = this->soundlist_.begin(); i != this->soundlist_.end(); i++)
-            (*i)->update();
-    }
-
-    /**
-    * Check if sound is available
-    */
-    bool SoundManager::isSoundAvailable()
-    {
-        return this->soundavailable_;
     }
 }
Index: /code/branches/core5/src/orxonox/sound/SoundManager.h
===================================================================
--- /code/branches/core5/src/orxonox/sound/SoundManager.h	(revision 5895)
+++ /code/branches/core5/src/orxonox/sound/SoundManager.h	(revision 5896)
@@ -39,9 +39,8 @@
     /**
      * The SoundManager class manages the OpenAL device, context and listener
-     * position. It has a list of all SoundBase objects and calls their update
-     * function every tick. It is a singleton.
+     * position. It is a singleton.
      *
      */
-    class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public Tickable
+    class _OrxonoxExport SoundManager : public Singleton<SoundManager>
     {
         friend class Singleton<SoundManager>;
@@ -49,18 +48,15 @@
         SoundManager();
         ~SoundManager();
-        void addSound(SoundBase* sound);
-        void removeSound(SoundBase* sound);
-        void tick(float dt);
-        bool isSoundAvailable();
+
+        void setListenerPosition(const Vector3& position);
+        void setListenerOrientation(const Quaternion& orientation);
 
     private:
         ALCdevice* device_;
         ALCcontext* context_;
-        std::list<SoundBase*> soundlist_;
-        bool soundavailable_;
 
         static SoundManager* singletonPtr_s;
-    }; // class SoundManager
-} // namespace orxonox
+    };
+}
 
 #endif /* _SoundManager_H__ */
Index: /code/branches/core5/src/orxonox/sound/WorldSound.cc
===================================================================
--- /code/branches/core5/src/orxonox/sound/WorldSound.cc	(revision 5896)
+++ /code/branches/core5/src/orxonox/sound/WorldSound.cc	(revision 5896)
@@ -0,0 +1,95 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Erwin 'vaiursch' Herrsche
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WorldSound.h"
+
+#include <AL/alut.h>
+#include "util/Math.h"
+#include "core/EventIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(WorldSound);
+
+    WorldSound::WorldSound(BaseObject* creator)
+        : StaticEntity(creator)
+    {
+        RegisterObject(WorldSound);
+    }
+
+    WorldSound::~WorldSound()
+    {
+    }
+
+    void WorldSound::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WorldSound, XMLPort, xmlelement, mode);
+        XMLPortParamExtern(WorldSound, BaseSound, this, "soundFile", setSoundFile, getSoundFile, xmlelement, mode);
+        XMLPortParamExtern(WorldSound, BaseSound, this, "loop", setLoop, getLoop, xmlelement, mode);
+        XMLPortParamExtern(WorldSound, BaseSound, this, "playOnLoad", setPlayOnLoad, getPlayOnLoad, xmlelement, mode);
+    }
+
+    void WorldSound::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WorldSound, XMLEventPort, xmlelement, mode);
+        XMLPortEventState(WorldSound, BaseObject, "play", play, xmlelement, mode);
+    }
+
+    void WorldSound::processEvent(Event& event)
+    {
+        SUPER(WorldSound, processEvent, event);
+    }
+
+    void WorldSound::tick(float dt)
+    {
+        if (alIsSource(this->source_))
+        {
+            const Vector3& pos = this->getWorldPosition();
+            alSource3f(this->source_, AL_POSITION, pos.x, pos.y, pos.z);
+            ALenum error = alGetError();
+            if (error == AL_INVALID_VALUE)
+                COUT(2) << "Sound: OpenAL: Invalid sound position" << std::endl;
+
+            const Vector3& vel = this->getVelocity();
+            alSource3f(this->source_, AL_VELOCITY, vel.x, vel.y, vel.z);
+            error = alGetError();
+            if (error == AL_INVALID_VALUE)
+                COUT(2) << "Sound: OpenAL: Invalid sound velocity" << std::endl;
+
+            const Quaternion& orient = this->getWorldOrientation();
+            Vector3 at = orient.zAxis();
+            alSource3f(this->source_, AL_DIRECTION, at.x, at.y, at.z);
+            error = alGetError();
+            if (error == AL_INVALID_VALUE)
+                COUT(2) << "Sound: OpenAL: Invalid sound direction" << std::endl;
+        }
+    }
+
+}
Index: /code/branches/core5/src/orxonox/sound/WorldSound.h
===================================================================
--- /code/branches/core5/src/orxonox/sound/WorldSound.h	(revision 5896)
+++ /code/branches/core5/src/orxonox/sound/WorldSound.h	(revision 5896)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+#ifndef _WorldSound_H__
+#define _WorldSound_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "sound/BaseSound.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    /*
+    @brief
+        The WorldSound class is to be used for sounds with position and orientation.
+    */
+    class _OrxonoxExport WorldSound : public StaticEntity, public BaseSound, public Tickable
+    {
+    public:
+        WorldSound(BaseObject* creator);
+        virtual ~WorldSound();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+
+        virtual void tick(float dt);
+
+        virtual void processEvent(Event& event);
+
+    private:
+    };
+}
+
+#endif /* _WorldSound_H__ */
