Index: /OpenSceneGraph/trunk/include/osg/ImageStream
===================================================================
--- /OpenSceneGraph/trunk/include/osg/ImageStream (revision 8990)
+++ /OpenSceneGraph/trunk/include/osg/ImageStream (revision 9827)
@@ -16,4 +16,5 @@
 
 #include <osg/Image>
+#include <osg/AudioStream>
 
 namespace osg {
@@ -87,4 +88,10 @@
         virtual void setVolume(float) {}
         virtual float getVolume() const { return 0.0f; }
+
+
+        typedef std::vector< osg::ref_ptr<osg::AudioStream> > AudioStreams;
+        void setAudioStreams(const AudioStreams& asl) { _audioStreams = asl; }
+        AudioStreams& getAudioStreams() { return _audioStreams; }
+        const AudioStreams& getAudioStreams() const { return _audioStreams; }
         
 
@@ -96,4 +103,6 @@
         StreamStatus    _status;
         LoopingMode     _loopingMode;
+        
+        AudioStreams    _audioStreams;
 };
 
Index: /OpenSceneGraph/trunk/include/osg/AudioStream
===================================================================
--- /OpenSceneGraph/trunk/include/osg/AudioStream (revision 9827)
+++ /OpenSceneGraph/trunk/include/osg/AudioStream (revision 9827)
@@ -0,0 +1,80 @@
+/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
+ *
+ * This library is open source and may be redistributed and/or modified under  
+ * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
+ * (at your option) any later version.  The full license is in LICENSE file
+ * included with this distribution, and on the openscenegraph.org website.
+ * 
+ * This library 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 
+ * OpenSceneGraph Public License for more details.
+*/
+
+#ifndef OSG_AUDIOSTREAM
+#define OSG_AUDIOSTREAM 1
+
+#include <osg/Image>
+
+namespace osg {
+
+/** Pure virtual AudioSinkInterface bass class that is used to connect the audio system with AudioStreams. */
+class OSG_EXPORT AudioSinkInterface : public osg::Object
+{
+public:
+
+    AudioSinkInterface();
+
+    virtual void startPlaying() = 0;
+    virtual bool playing() const = 0;
+
+    virtual double getDelay() const { return _delay; }
+    virtual void setDelay(const double delay) { _delay = delay; }
+
+    virtual const char * libraryName() const { return "osgFFmpeg"; }
+    virtual const char * className() const { return "AudioSinkInterface"; }
+
+private:
+
+    virtual AudioSinkInterface * cloneType() const { return 0; }
+    virtual AudioSinkInterface * clone(const osg::CopyOp &) const { return 0; }
+
+    double  _delay;
+};
+
+/** Pure virtual AudioStream base class. Subclasses provide mechanism for reading/generating audio data*/
+class OSG_EXPORT AudioStream : public osg::Object
+{
+    public:
+        AudioStream();
+
+        /** Copy constructor using CopyOp to manage deep vs shallow copy. */
+        AudioStream(const AudioStream& audio,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
+
+        virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const AudioStream*>(obj)!=0; }
+        virtual const char* libraryName() const { return "osg"; }
+        virtual const char* className() const { return "AudioStream"; }
+
+        virtual void setAudioSink(osg::AudioSinkInterface* audio_sink) = 0;
+        
+        virtual void consumeAudioBuffer(void * const buffer, const size_t size) = 0;
+        
+        virtual bool audioStream() const = 0;
+        virtual int audioFrequency() const = 0;
+        virtual int audioNbChannels() const = 0;
+
+        enum SampleFormat
+        {
+            SAMPLE_FORMAT_U8,
+            SAMPLE_FORMAT_S16,
+            SAMPLE_FORMAT_S24,
+            SAMPLE_FORMAT_S32,
+            SAMPLE_FORMAT_F32
+        };
+
+        virtual SampleFormat audioSampleFormat() const = 0;
+};
+
+} // namespace
+
+#endif
Index: /OpenSceneGraph/trunk/src/osg/ImageStream.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osg/ImageStream.cpp (revision 8915)
+++ /OpenSceneGraph/trunk/src/osg/ImageStream.cpp (revision 9827)
@@ -33,5 +33,6 @@
     Image(image,copyop),
     _status(image._status),
-    _loopingMode(image._loopingMode)
+    _loopingMode(image._loopingMode),
+    _audioStreams(image._audioStreams)
 {
 }
Index: /OpenSceneGraph/trunk/src/osg/AudioStream.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osg/AudioStream.cpp (revision 9827)
+++ /OpenSceneGraph/trunk/src/osg/AudioStream.cpp (revision 9827)
@@ -0,0 +1,30 @@
+/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
+ *
+ * This library is open source and may be redistributed and/or modified under  
+ * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
+ * (at your option) any later version.  The full license is in LICENSE file
+ * included with this distribution, and on the openscenegraph.org website.
+ * 
+ * This library 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 
+ * OpenSceneGraph Public License for more details.
+*/
+
+#include <osg/AudioStream>
+
+using namespace osg;
+
+AudioSinkInterface::AudioSinkInterface() :
+    _delay(0.0)
+{
+}
+
+AudioStream::AudioStream()
+{
+}
+
+AudioStream::AudioStream(const AudioStream& audio,const CopyOp& copyop):
+    osg::Object(audio, copyop)
+{
+}
Index: /OpenSceneGraph/trunk/src/osg/CMakeLists.txt
===================================================================
--- /OpenSceneGraph/trunk/src/osg/CMakeLists.txt (revision 9671)
+++ /OpenSceneGraph/trunk/src/osg/CMakeLists.txt (revision 9827)
@@ -26,4 +26,5 @@
     ${HEADER_PATH}/ArgumentParser
     ${HEADER_PATH}/Array
+    ${HEADER_PATH}/AudioStream
     ${HEADER_PATH}/AutoTransform
     ${HEADER_PATH}/Billboard
@@ -194,4 +195,5 @@
     ArgumentParser.cpp
     Array.cpp
+    AudioStream.cpp
     AutoTransform.cpp
     Billboard.cpp
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp (revision 9816)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp (revision 9827)
@@ -3,7 +3,9 @@
 #define HEADER_GUARD_FFMPEG_HEADERS_H
 
+
 extern "C"
 {
 #define __STDC_CONSTANT_MACROS
+#include <stdint.h>
 #include <avcodec.h>
 #include <avformat.h>
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (revision 9826)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (revision 9827)
@@ -57,5 +57,5 @@
         m_frequency = m_context->sample_rate;
         m_nb_channels = m_context->channels;
-        m_sample_format = FFmpegSampleFormat(m_context->sample_fmt);
+        m_sample_format = osg::AudioStream::SampleFormat(m_context->sample_fmt);
 
         // Check stream sanity
@@ -200,21 +200,21 @@
     switch (sampleFormat())
     {
-    case SAMPLE_FORMAT_U8:
+    case osg::AudioStream::SAMPLE_FORMAT_U8:
         sample_size *= 1;
         break;
 
-    case SAMPLE_FORMAT_S16:
+    case osg::AudioStream::SAMPLE_FORMAT_S16:
         sample_size *= 2;
         break;
 
-    case SAMPLE_FORMAT_S24:
+    case osg::AudioStream::SAMPLE_FORMAT_S24:
         sample_size *= 3;
         break;
 
-    case SAMPLE_FORMAT_S32:
+    case osg::AudioStream::SAMPLE_FORMAT_S32:
         sample_size *= 4;
         break;
 
-    case SAMPLE_FORMAT_F32:
+    case osg::AudioStream::SAMPLE_FORMAT_F32:
         sample_size *= 4;
         break;
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp (revision 9826)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp (revision 9827)
@@ -7,8 +7,9 @@
 #include "FFmpegClocks.hpp"
 #include "FFmpegPacket.hpp"
-#include "FFmpegSampleFormat.hpp"
 
-#include "AudioSinkInterface.hpp"
+#include <osg/AudioStream>
+
 #include "BoundedMessageQueue.hpp"
+
 
 
@@ -37,5 +38,5 @@
     int frequency() const;
     int nbChannels() const;
-    FFmpegSampleFormat sampleFormat() const;
+    osg::AudioStream::SampleFormat sampleFormat() const;
 
 private:
@@ -64,5 +65,5 @@
     int                    m_frequency;
     int                    m_nb_channels;
-    FFmpegSampleFormat    m_sample_format;
+    osg::AudioStream::SampleFormat    m_sample_format;
 
     SinkPtr                m_audio_sink;
@@ -94,5 +95,5 @@
 
 
-inline FFmpegSampleFormat FFmpegDecoderAudio::sampleFormat() const
+inline osg::AudioStream::SampleFormat FFmpegDecoderAudio::sampleFormat() const
 {
     return m_sample_format;
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp (revision 9826)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp (revision 9827)
@@ -128,5 +128,5 @@
 
 
-void FFmpegImageStream::fillAudioBuffer(void * const buffer, const size_t size)
+void FFmpegImageStream::consumeAudioBuffer(void * const buffer, const size_t size)
 { 
     m_decoder->audio_decoder().fillBuffer(buffer, size);
@@ -184,5 +184,5 @@
 
 
-FFmpegSampleFormat FFmpegImageStream::audioSampleFormat() const 
+osg::AudioStream::SampleFormat FFmpegImageStream::audioSampleFormat() const 
 { 
     return m_decoder->audio_decoder().sampleFormat(); 
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.hpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.hpp (revision 9826)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegImageStream.hpp (revision 9827)
@@ -8,8 +8,4 @@
 #include <OpenThreads/Thread>
 
-#include "AudioSinkInterface.hpp"
-#include "FFmpegSampleFormat.hpp"
-
-
 
 #ifdef _WIN32
@@ -19,5 +15,5 @@
     #define OSGFFMPEG_EXPORT_API  __declspec(dllexport)
     #else
-    #define OSGFFMPEG_EXPORT_API  __declspec(dllimport)
+    #define OSGFFMPEG_EXPORT_API  __declspec(dllimport);
     #endif
 #else
@@ -56,5 +52,10 @@
         virtual void setAudioSink(osg::AudioSinkInterface* audio_sink);
         
-        void fillAudioBuffer(void * const buffer, const size_t size);
+        void consumeAudioBuffer(void * const buffer, const size_t size);
+        
+        bool audioStream() const;
+        int audioFrequency() const;
+        int audioNbChannels() const;
+        osg::AudioStream::SampleFormat audioSampleFormat() const;
 
         double duration() const;
@@ -64,8 +65,4 @@
         double videoFrameRate() const;
 
-        bool audioStream() const;
-        int audioFrequency() const;
-        int audioNbChannels() const;
-        FFmpegSampleFormat audioSampleFormat() const;
 
     private:
Index: /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt (revision 9818)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt (revision 9827)
@@ -21,5 +21,4 @@
 
 SET(TARGET_H
-    AudioSinkInterface.hpp
     BoundedMessageQueue.hpp
     FFmpegClocks.hpp
Index: /enSceneGraph/trunk/src/osgPlugins/ffmpeg/AudioSinkInterface.hpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/AudioSinkInterface.hpp (revision 9826)
+++  (revision )
@@ -1,40 +1,0 @@
-
-#ifndef OSG_AUDIOSINKINTERFACE_H
-#define OSG_AUDIOSINKINTERFACE_H
-
-#include <osg/Object>
-
-
-
-namespace osg
-{
-
-    class AudioSinkInterface : public osg::Object
-    {
-    public:
-
-        AudioSinkInterface() :
-            m_delay(0.0) { }
-
-        virtual void startPlaying() = 0;
-        virtual bool playing() const = 0;
-
-        virtual double getDelay() const { return m_delay; }
-        virtual void setDelay(const double delay) { m_delay = delay; }
-
-        virtual const char * libraryName() const { return "osgFFmpeg"; }
-        virtual const char * className() const { return "AudioSinkInterface"; }
-
-    private:
-
-        virtual AudioSinkInterface * cloneType() const { return 0; }
-        virtual AudioSinkInterface * clone(const osg::CopyOp &) const { return 0; }
-
-        double    m_delay;
-    };
-
-}
-
-
-
-#endif // HEADER_GUARD_OSGFFMPEG_AUDIO_SINK_INTERFACE_H
Index: /enSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegSampleFormat.hpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegSampleFormat.hpp (revision 9816)
+++  (revision )
@@ -1,23 +1,0 @@
-
-#ifndef HEADER_GUARD_OSGFFMPEG_FFMPEG_SAMPLE_FORMAT_H
-#define HEADER_GUARD_OSGFFMPEG_FFMPEG_SAMPLE_FORMAT_H
-
-
-
-namespace osgFFmpeg
-{
-
-    enum FFmpegSampleFormat
-    {
-        SAMPLE_FORMAT_U8,    //= SAMPLE_FMT_U8,
-        SAMPLE_FORMAT_S16,    //= SAMPLE_FMT_S16,
-        SAMPLE_FORMAT_S24,    //= SAMPLE_FMT_S24,
-        SAMPLE_FORMAT_S32,    //= SAMPLE_FMT_S32,
-        SAMPLE_FORMAT_F32    //= SAMPLE_FMT_FLT
-    };
-
-}
-
-
-
-#endif // HEADER_GUARD_OSGFFMPEG_FFMPEG_SAMPLE_FORMAT_H
