Преглед изворни кода

Removed unneccessary dllexport modifiers from audio plugins
Added Ogg Vorbis encoding to FMOD importer

BearishSun пре 9 година
родитељ
комит
79cb441322
33 измењених фајлова са 80 додато и 119 уклоњено
  1. 9 0
      Source/BansheeCore/Include/BsCommonTypes.h
  2. 8 5
      Source/BansheeFMOD/CMakeLists.txt
  3. 2 0
      Source/BansheeFMOD/CMakeSources.cmake
  4. 1 1
      Source/BansheeFMOD/Include/BsFMODAudio.h
  5. 1 1
      Source/BansheeFMOD/Include/BsFMODAudioClip.h
  6. 1 1
      Source/BansheeFMOD/Include/BsFMODAudioListener.h
  7. 1 1
      Source/BansheeFMOD/Include/BsFMODAudioSource.h
  8. 1 1
      Source/BansheeFMOD/Include/BsFMODImporter.h
  9. 0 25
      Source/BansheeFMOD/Include/BsFMODPrerequisites.h
  10. 1 1
      Source/BansheeFMOD/Source/BsFMODAudioClip.cpp
  11. 8 8
      Source/BansheeFMOD/Source/BsFMODImporter.cpp
  12. 0 3
      Source/BansheeOpenAudio/CMakeLists.txt
  13. 2 2
      Source/BansheeOpenAudio/CMakeSources.cmake
  14. 2 2
      Source/BansheeOpenAudio/Include/BsOAAudio.h
  15. 1 1
      Source/BansheeOpenAudio/Include/BsOAAudioClip.h
  16. 1 1
      Source/BansheeOpenAudio/Include/BsOAAudioListener.h
  17. 2 2
      Source/BansheeOpenAudio/Include/BsOAAudioSource.h
  18. 2 2
      Source/BansheeOpenAudio/Include/BsOAFLACReader.h
  19. 1 1
      Source/BansheeOpenAudio/Include/BsOAFileReader.h
  20. 1 1
      Source/BansheeOpenAudio/Include/BsOAImporter.h
  21. 1 1
      Source/BansheeOpenAudio/Include/BsOAOggVorbisReader.h
  22. 0 25
      Source/BansheeOpenAudio/Include/BsOAPrerequisites.h
  23. 2 2
      Source/BansheeOpenAudio/Include/BsOAWaveReader.h
  24. 6 6
      Source/BansheeOpenAudio/Include/BsOggVorbisWriter.h
  25. 1 1
      Source/BansheeOpenAudio/Source/BsOAAudio.cpp
  26. 2 2
      Source/BansheeOpenAudio/Source/BsOAAudioClip.cpp
  27. 2 2
      Source/BansheeOpenAudio/Source/BsOAAudioSource.cpp
  28. 1 1
      Source/BansheeOpenAudio/Source/BsOAFLACReader.cpp
  29. 3 3
      Source/BansheeOpenAudio/Source/BsOAImporter.cpp
  30. 1 1
      Source/BansheeOpenAudio/Source/BsOAOggVorbisReader.cpp
  31. 4 4
      Source/BansheeOpenAudio/Source/BsOAPlugin.cpp
  32. 2 2
      Source/BansheeOpenAudio/Source/BsOAWaveReader.cpp
  33. 10 10
      Source/BansheeOpenAudio/Source/BsOggVorbisWriter.cpp

+ 9 - 0
Source/BansheeCore/Include/BsCommonTypes.h

@@ -392,6 +392,15 @@ namespace BansheeEngine
 		UINT32 numArraySlices;
 	};
 
+	/** Meta-data describing a chunk of audio. */
+	struct AudioDataInfo
+	{
+		UINT32 numSamples; /**< Total number of audio samples in the audio data (includes all channels). */
+		UINT32 sampleRate; /**< Number of audio samples per second, per channel. */
+		UINT32 numChannels; /**< Number of channels. Each channel has its own set of samples. */
+		UINT32 bitDepth; /**< Number of bits per sample. */
+	};
+
 	/** Helper class for syncing dirty data from sim CoreObject to core CoreObject and other way around. */
 	class CoreSyncData
 	{

+ 8 - 5
Source/BansheeFMOD/CMakeLists.txt

@@ -9,18 +9,18 @@ set(BansheeFMOD_INC
 	"Include" 
 	"../BansheeUtility/Include" 
 	"../BansheeCore/Include"
-	${FMOD_INCLUDE_DIRS})
+	"../BansheeOpenAudio/Include"
+	${FMOD_INCLUDE_DIRS}
+	"../../Dependencies/libogg/include"
+	"../../Dependencies/libvorbis/include")
 
 include_directories(${BansheeFMOD_INC})	
 	
 # Target
 add_library(BansheeFMOD SHARED ${BS_BANSHEEFMOD_SRC})
 
-# Defines
-target_compile_definitions(BansheeFMOD PRIVATE -DBS_FMOD_EXPORTS)
-
 # Libraries
-## External libs: FMOD
+## External libs: FMOD, Vorbis, Ogg
 add_library(FMOD STATIC IMPORTED)
 
 set_target_properties(FMOD PROPERTIES IMPORTED_LOCATION_DEBUG "${FMOD_LIBRARIES_DEBUG}")
@@ -29,6 +29,9 @@ set_target_properties(FMOD PROPERTIES IMPORTED_LOCATION_RELEASE "${FMOD_LIBRARIE
 
 target_link_libraries(BansheeFMOD PRIVATE FMOD)	
 
+add_library_per_config(BansheeFMOD libvorbis libvorbis libvorbis)
+add_library_per_config(BansheeFMOD libogg Release/libogg Debug/libogg)
+
 ## Local libs
 target_link_libraries(BansheeFMOD PUBLIC BansheeUtility BansheeCore)
 

+ 2 - 0
Source/BansheeFMOD/CMakeSources.cmake

@@ -5,6 +5,7 @@ set(BS_BANSHEEFMOD_INC_NOFILTER
 	"Include/BsFMODAudioSource.h"
 	"Include/BsFMODAudioListener.h"
 	"Include/BsFMODAudioClip.h"
+	"../BansheeOpenAudio/Include/BsOggVorbisWriter.h"
 )
 
 set(BS_BANSHEEFMOD_SRC_NOFILTER
@@ -14,6 +15,7 @@ set(BS_BANSHEEFMOD_SRC_NOFILTER
 	"Source/BsFMODAudioSource.cpp"
 	"Source/BsFMODAudioListener.cpp"
 	"Source/BsFMODAudioClip.cpp"
+	"../BansheeOpenAudio/Source/BsOggVorbisWriter.cpp"
 )
 
 source_group("Header Files" FILES ${BS_BANSHEEFMOD_INC_NOFILTER})

+ 1 - 1
Source/BansheeFMOD/Include/BsFMODAudio.h

@@ -13,7 +13,7 @@ namespace BansheeEngine
 	 */
 	
 	/** Global manager for the audio implementation using FMOD as the backend. */
-	class BS_FMOD_EXPORT FMODAudio : public Audio
+	class FMODAudio : public Audio
 	{
 	public:
 		FMODAudio();

+ 1 - 1
Source/BansheeFMOD/Include/BsFMODAudioClip.h

@@ -13,7 +13,7 @@ namespace BansheeEngine
 	 */
 	
 	/** FMOD implementation of an AudioClip. */
-	class BS_FMOD_EXPORT FMODAudioClip : public AudioClip
+	class FMODAudioClip : public AudioClip
 	{
 	public:
 		FMODAudioClip(const SPtr<DataStream>& samples, UINT32 streamSize, UINT32 numSamples, const AUDIO_CLIP_DESC& desc);

+ 1 - 1
Source/BansheeFMOD/Include/BsFMODAudioListener.h

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	 */
 	
 	/** FMOD implementation of an AudioListener. */
-	class BS_FMOD_EXPORT FMODAudioListener : public AudioListener
+	class FMODAudioListener : public AudioListener
 	{
 	public:
 		FMODAudioListener();

+ 1 - 1
Source/BansheeFMOD/Include/BsFMODAudioSource.h

@@ -13,7 +13,7 @@ namespace BansheeEngine
 	 */
 	
 	/** FMOD implementation of an AudioSource. */
-	class BS_FMOD_EXPORT FMODAudioSource : public AudioSource
+	class FMODAudioSource : public AudioSource
 	{
 	public:
 		FMODAudioSource();

+ 1 - 1
Source/BansheeFMOD/Include/BsFMODImporter.h

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	 */
 
 	/** Importer using for importing WAV/FLAC/OGGVORBIS audio files. */
-	class BS_FMOD_EXPORT FMODImporter : public SpecificImporter
+	class FMODImporter : public SpecificImporter
 	{
 	public:
 		FMODImporter();

+ 0 - 25
Source/BansheeFMOD/Include/BsFMODPrerequisites.h

@@ -4,36 +4,11 @@
 
 #include "BsCorePrerequisites.h"
 
-#if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__)
-#	ifdef BS_FMOD_EXPORTS
-#		define BS_FMOD_EXPORT __declspec(dllexport)
-#	else
-#       if defined( __MINGW32__ )
-#           define BS_FMOD_EXPORT
-#       else
-#    		define BS_FMOD_EXPORT __declspec(dllimport)
-#       endif
-#	endif
-#elif defined (BS_GCC_VISIBILITY)
-#    define BS_FMOD_EXPORT  __attribute__ ((visibility("default")))
-#else
-#    define BS_FMOD_EXPORT
-#endif
-
 namespace BansheeEngine
 {
 	class FMODAudioListener;
 	class FMODAudioSource;
 	class FMODAudioClip;
-
-	/** Contains data describing an audio file. */
-	struct AudioFileInfo
-	{
-		UINT32 numSamples; /**< Total number of audio samples in the audio data (includes all channels). */
-		UINT32 sampleRate; /**< Number of audio samples per second, per channel. */
-		UINT32 numChannels; /**< Number of channels. Each channel has its own set of samples. */
-		UINT32 bitDepth; /**< Number of bits per sample. */
-	};
 }
 
 /** @addtogroup Plugins

+ 1 - 1
Source/BansheeFMOD/Source/BsFMODAudioClip.cpp

@@ -18,7 +18,7 @@ namespace BansheeEngine
 
 	void FMODAudioClip::initialize()
 	{
-		AudioFileInfo info;
+		AudioDataInfo info;
 		info.bitDepth = mDesc.bitDepth;
 		info.numChannels = mDesc.numChannels;
 		info.numSamples = mNumSamples;

+ 8 - 8
Source/BansheeFMOD/Source/BsFMODImporter.cpp

@@ -6,6 +6,7 @@
 #include "BsAudioClipImportOptions.h"
 #include "BsAudioUtility.h"
 #include "BsFMODAudio.h"
+#include "BsOggVorbisWriter.h"
 
 #include <fmod.hpp>
 
@@ -48,7 +49,7 @@ namespace BansheeEngine
 		WString extension = filePath.getWExtension();
 		StringUtil::toLowerCase(extension);
 
-		AudioFileInfo info;
+		AudioDataInfo info;
 
 		FMOD::Sound* sound;
 		String pathStr = filePath.toString();
@@ -153,14 +154,13 @@ namespace BansheeEngine
 		// Encode to Ogg Vorbis if needed
 		if (clipIO->getFormat() == AudioFormat::VORBIS)
 		{
+			// Note: If the original source was in Ogg Vorbis we could just copy it here, but instead we decode to PCM and
+			// then re-encode which is redundant. If later we decide to copy be aware that the engine encodes Ogg in a
+			// specific quality, and the the import source might have lower or higher bitrate/quality.
+			UINT8* encodedSamples = OggVorbisWriter::PCMToOggVorbis(sampleBuffer, info, bufferSize);
 
-
-
-			// TODO - Encode to Ogg Vorbis!
-
-
-
-
+			bs_free(sampleBuffer);
+			sampleBuffer = encodedSamples;
 		}
 
 		SPtr<MemoryDataStream> sampleStream = bs_shared_ptr_new<MemoryDataStream>(sampleBuffer, bufferSize);

+ 0 - 3
Source/BansheeOpenAudio/CMakeLists.txt

@@ -16,9 +16,6 @@ include_directories(${BansheeOpenAudio_INC})
 # Target
 add_library(BansheeOpenAudio SHARED ${BS_BANSHEEOPENAUDIO_SRC})
 
-# Defines
-target_compile_definitions(BansheeOpenAudio PRIVATE -DBS_OA_EXPORTS)
-
 # Libraries
 ## External libs: FLAC, Vorbis, Ogg, OpenAL
 add_library_per_config(BansheeOpenAudio libFLAC libFLAC libFLAC)

+ 2 - 2
Source/BansheeOpenAudio/CMakeSources.cmake

@@ -5,7 +5,7 @@ set(BS_BANSHEEOPENAUDIO_INC_NOFILTER
 	"Include/BsOAOggVorbisReader.h"
 	"Include/BsOAFLACReader.h"
 	"Include/BsOAFileReader.h"
-	"Include/BsOAOggVorbisWriter.h"
+	"Include/BsOggVorbisWriter.h"
 	"Include/BsOAAudioClip.h"
 	"Include/BsOAAudio.h"
 	"Include/BsOAAudioSource.h"
@@ -18,7 +18,7 @@ set(BS_BANSHEEOPENAUDIO_SRC_NOFILTER
 	"Source/BsOAWaveReader.cpp"
 	"Source/BsOAOggVorbisReader.cpp"
 	"Source/BsOAFLACReader.cpp"
-	"Source/BsOAOggVorbisWriter.cpp"
+	"Source/BsOggVorbisWriter.cpp"
 	"Source/BsOAAudioClip.cpp"
 	"Source/BsOAAudio.cpp"
 	"Source/BsOAAudioSource.cpp"

+ 2 - 2
Source/BansheeOpenAudio/Include/BsOAAudio.h

@@ -13,7 +13,7 @@ namespace BansheeEngine
 	 */
 	
 	/** Global manager for the audio implementation using OpenAL as the backend. */
-	class BS_OA_EXPORT OAAudio : public Audio
+	class OAAudio : public Audio
 	{
 	public:
 		OAAudio();
@@ -81,7 +81,7 @@ namespace BansheeEngine
 		 * Writes provided samples into the OpenAL buffer with the provided ID. If the provided format is not supported the
 		 * samples will first be converted into a valid format.
 		 */
-		void _writeToOpenALBuffer(UINT32 bufferId, UINT8* samples, const AudioFileInfo& info);
+		void _writeToOpenALBuffer(UINT32 bufferId, UINT8* samples, const AudioDataInfo& info);
 
 		/** @} */
 

+ 1 - 1
Source/BansheeOpenAudio/Include/BsOAAudioClip.h

@@ -13,7 +13,7 @@ namespace BansheeEngine
 	 */
 	
 	/** OpenAudio implementation of an AudioClip. */
-	class BS_OA_EXPORT OAAudioClip : public AudioClip
+	class OAAudioClip : public AudioClip
 	{
 	public:
 		OAAudioClip(const SPtr<DataStream>& samples, UINT32 streamSize, UINT32 numSamples, const AUDIO_CLIP_DESC& desc);

+ 1 - 1
Source/BansheeOpenAudio/Include/BsOAAudioListener.h

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	 */
 	
 	/** OpenAL implementation of an AudioListener. */
-	class BS_OA_EXPORT OAAudioListener : public AudioListener
+	class OAAudioListener : public AudioListener
 	{
 	public:
 		OAAudioListener();

+ 2 - 2
Source/BansheeOpenAudio/Include/BsOAAudioSource.h

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	 */
 	
 	/** OpenAL implementation of an AudioSource. */
-	class BS_OA_EXPORT OAAudioSource : public AudioSource
+	class OAAudioSource : public AudioSource
 	{
 	public:
 		OAAudioSource();
@@ -97,7 +97,7 @@ namespace BansheeEngine
 		bool requiresStreaming() const;
 
 		/** Fills the provided buffer with streaming data. */
-		bool fillBuffer(UINT32 buffer, AudioFileInfo& info, UINT32 maxNumSamples);
+		bool fillBuffer(UINT32 buffer, AudioDataInfo& info, UINT32 maxNumSamples);
 
 		Vector<UINT32> mSourceIDs;
 		float mSavedTime;

+ 2 - 2
Source/BansheeOpenAudio/Include/BsOAFLACReader.h

@@ -17,7 +17,7 @@ namespace BansheeEngine
 	{
 		SPtr<DataStream> stream;
 		UINT32 streamOffset = 0;
-		AudioFileInfo info;
+		AudioDataInfo info;
 		UINT8* output = nullptr;
 		Vector<UINT8> overflow;
 		UINT32 samplesToRead = 0;
@@ -32,7 +32,7 @@ namespace BansheeEngine
 		~OAFLACReader();
 
 		/** @copydoc OAFileReader::open */
-		bool open(const SPtr<DataStream>& stream, AudioFileInfo& info, UINT32 offset = 0) override;
+		bool open(const SPtr<DataStream>& stream, AudioDataInfo& info, UINT32 offset = 0) override;
 
 		/** @copydoc OAFileReader::seek */
 		void seek(UINT32 offset) override;

+ 1 - 1
Source/BansheeOpenAudio/Include/BsOAFileReader.h

@@ -24,7 +24,7 @@ namespace BansheeEngine
 		 * @param[in]	offset	Offset at which audio data in the stream begins, in bytes.
 		 * @return				True if the data is valid, false otherwise.
 		 */
-		virtual bool open(const SPtr<DataStream>& stream, AudioFileInfo& info, UINT32 offset = 0) = 0;
+		virtual bool open(const SPtr<DataStream>& stream, AudioDataInfo& info, UINT32 offset = 0) = 0;
 
 		/** 
 		 * Moves the read pointer to the specified offset. Any further read() calls will read from this location. User must

+ 1 - 1
Source/BansheeOpenAudio/Include/BsOAImporter.h

@@ -12,7 +12,7 @@ namespace BansheeEngine
 	 */
 
 	/** Importer using for importing WAV/FLAC/OGGVORBIS audio files. */
-	class BS_OA_EXPORT OAImporter : public SpecificImporter
+	class OAImporter : public SpecificImporter
 	{
 	public:
 		OAImporter();

+ 1 - 1
Source/BansheeOpenAudio/Include/BsOAOggVorbisReader.h

@@ -31,7 +31,7 @@ namespace BansheeEngine
 		~OAOggVorbisReader();
 
 		/** @copydoc OAFileReader::open */
-		bool open(const SPtr<DataStream>& stream, AudioFileInfo& info, UINT32 offset = 0) override;
+		bool open(const SPtr<DataStream>& stream, AudioDataInfo& info, UINT32 offset = 0) override;
 
 		/** @copydoc OAFileReader::read */
 		UINT32 read(UINT8* samples, UINT32 numSamples) override;

+ 0 - 25
Source/BansheeOpenAudio/Include/BsOAPrerequisites.h

@@ -4,33 +4,8 @@
 
 #include "BsCorePrerequisites.h"
 
-#if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__)
-#	ifdef BS_OA_EXPORTS
-#		define BS_OA_EXPORT __declspec(dllexport)
-#	else
-#       if defined( __MINGW32__ )
-#           define BS_OA_EXPORT
-#       else
-#    		define BS_OA_EXPORT __declspec(dllimport)
-#       endif
-#	endif
-#elif defined ( BS_GCC_VISIBILITY )
-#    define BS_OA_EXPORT  __attribute__ ((visibility("default")))
-#else
-#    define BS_OA_EXPORT
-#endif
-
 namespace BansheeEngine
 {
-	/** Contains data describing an audio file. */
-	struct AudioFileInfo
-	{
-		UINT32 numSamples; /**< Total number of audio samples in the audio data (includes all channels). */
-		UINT32 sampleRate; /**< Number of audio samples per second, per channel. */
-		UINT32 numChannels; /**< Number of channels. Each channel has its own set of samples. */
-		UINT32 bitDepth; /**< Number of bits per sample. */
-	};
-
 	class OAAudioListener;
 	class OAAudioSource;
 }

+ 2 - 2
Source/BansheeOpenAudio/Include/BsOAWaveReader.h

@@ -18,7 +18,7 @@ namespace BansheeEngine
 		OAWaveReader();
 
 		/** @copydoc OAFileReader::open */
-		bool open(const SPtr<DataStream>& stream, AudioFileInfo& info, UINT32 offset = 0) override;
+		bool open(const SPtr<DataStream>& stream, AudioDataInfo& info, UINT32 offset = 0) override;
 
 		/** @copydoc OAFileReader::read */
 		UINT32 read(UINT8* samples, UINT32 numSamples) override;
@@ -30,7 +30,7 @@ namespace BansheeEngine
 		bool isValid(const SPtr<DataStream>& stream, UINT32 offset = 0) override;
 	private:
 		/** Parses the WAVE header and output audio file meta-data. Returns false if the header is not valid. */
-		bool parseHeader(AudioFileInfo& info);
+		bool parseHeader(AudioDataInfo& info);
 
 		SPtr<DataStream> mStream;
 		UINT32 mDataOffset;

+ 6 - 6
Source/BansheeOpenAudio/Include/BsOAOggVorbisWriter.h → Source/BansheeOpenAudio/Include/BsOggVorbisWriter.h

@@ -2,7 +2,7 @@
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 #pragma once
 
-#include "BsOAPrerequisites.h"
+#include "BsCorePrerequisites.h"
 #include "vorbis\vorbisenc.h"
 
 namespace BansheeEngine
@@ -11,12 +11,12 @@ namespace BansheeEngine
 	 *  @{
 	 */
 
-	/** Used for writing Ogg Vorbis audio data. */
-	class OAOggVorbisWriter
+	/** Used for encoding PCM to Ogg Vorbis audio data. */
+	class OggVorbisWriter
 	{
 	public:
-		OAOggVorbisWriter();
-		~OAOggVorbisWriter();
+		OggVorbisWriter();
+		~OggVorbisWriter();
 
 		/** 
 		 * Sets up the writer. Should be called before calling write(). 
@@ -60,7 +60,7 @@ namespace BansheeEngine
 		 * @param[out]	size		Number of bytes written to the output buffer.
 		 * @return					Buffer containing the encoded samples, allocated using the general allocator.
 		 */
-		static UINT8* PCMToOggVorbis(UINT8* samples, const AudioFileInfo& info, UINT32& size);
+		static UINT8* PCMToOggVorbis(UINT8* samples, const AudioDataInfo& info, UINT32& size);
 	private:
 		/** Writes Vorbis blocks into Ogg packets. */
 		void writeBlocks();

+ 1 - 1
Source/BansheeOpenAudio/Source/BsOAAudio.cpp

@@ -351,7 +351,7 @@ namespace BansheeEngine
 		}
 	}
 
-	void OAAudio::_writeToOpenALBuffer(UINT32 bufferId, UINT8* samples, const AudioFileInfo& info)
+	void OAAudio::_writeToOpenALBuffer(UINT32 bufferId, UINT8* samples, const AudioDataInfo& info)
 	{
 		if (info.numChannels <= 2) // Mono or stereo
 		{

+ 2 - 2
Source/BansheeOpenAudio/Source/BsOAAudioClip.cpp

@@ -1,7 +1,7 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 #include "BsOAAudioClip.h"
-#include "BsOAOggVorbisWriter.h"
+#include "BsOggVorbisWriter.h"
 #include "BsOAOggVorbisReader.h"
 #include "BsDataStream.h"
 #include "BsOAAudio.h"
@@ -25,7 +25,7 @@ namespace BansheeEngine
 			Lock lock(mMutex); // Needs to be called even if stream data is null, to ensure memory fence is added so the
 							   // other thread sees properly initialized AudioClip members
 
-			AudioFileInfo info;
+			AudioDataInfo info;
 			info.bitDepth = mDesc.bitDepth;
 			info.numChannels = mDesc.numChannels;
 			info.numSamples = mNumSamples;

+ 2 - 2
Source/BansheeOpenAudio/Source/BsOAAudioSource.cpp

@@ -469,7 +469,7 @@ namespace BansheeEngine
 		// ends up to be needed, then I'll need to lock every audio source operation to avoid other thread changing
 		// the context.
 
-		AudioFileInfo info;
+		AudioDataInfo info;
 		info.bitDepth = mAudioClip->getBitDepth();
 		info.numChannels = mAudioClip->getNumChannels();
 		info.sampleRate = mAudioClip->getFrequency();
@@ -551,7 +551,7 @@ namespace BansheeEngine
 		}
 	}
 
-	bool OAAudioSource::fillBuffer(UINT32 buffer, AudioFileInfo& info, UINT32 maxNumSamples)
+	bool OAAudioSource::fillBuffer(UINT32 buffer, AudioDataInfo& info, UINT32 maxNumSamples)
 	{
 		UINT32 numRemainingSamples = maxNumSamples - mStreamQueuedPosition;
 		if (numRemainingSamples == 0) // Reached the end

+ 1 - 1
Source/BansheeOpenAudio/Source/BsOAFLACReader.cpp

@@ -165,7 +165,7 @@ namespace BansheeEngine
 		return valid && !data.error;
 	}
 
-	bool OAFLACReader::open(const SPtr<DataStream>& stream, AudioFileInfo& info, UINT32 offset)
+	bool OAFLACReader::open(const SPtr<DataStream>& stream, AudioDataInfo& info, UINT32 offset)
 	{
 		if (stream == nullptr)
 			return false;

+ 3 - 3
Source/BansheeOpenAudio/Source/BsOAImporter.cpp

@@ -6,7 +6,7 @@
 #include "BsOAWaveReader.h"
 #include "BsOAFLACReader.h"
 #include "BsOAOggVorbisReader.h"
-#include "BsOAOggVorbisWriter.h"
+#include "BsOggVorbisWriter.h"
 #include "BsAudioClipImportOptions.h"
 #include "BsAudioUtility.h"
 
@@ -60,7 +60,7 @@ namespace BansheeEngine
 		if (reader == nullptr)
 			return nullptr;
 
-		AudioFileInfo info;
+		AudioDataInfo info;
 		if (!reader->isValid(stream))
 			return nullptr;
 
@@ -115,7 +115,7 @@ namespace BansheeEngine
 			// Note: If the original source was in Ogg Vorbis we could just copy it here, but instead we decode to PCM and
 			// then re-encode which is redundant. If later we decide to copy be aware that the engine encodes Ogg in a
 			// specific quality, and the the import source might have lower or higher bitrate/quality.
-			UINT8* encodedSamples = OAOggVorbisWriter::PCMToOggVorbis(sampleBuffer, info, bufferSize);
+			UINT8* encodedSamples = OggVorbisWriter::PCMToOggVorbis(sampleBuffer, info, bufferSize);
 
 			bs_free(sampleBuffer);
 			sampleBuffer = encodedSamples;

+ 1 - 1
Source/BansheeOpenAudio/Source/BsOAOggVorbisReader.cpp

@@ -68,7 +68,7 @@ namespace BansheeEngine
 		return false;
 	}
 
-	bool OAOggVorbisReader::open(const SPtr<DataStream>& stream, AudioFileInfo& info, UINT32 offset)
+	bool OAOggVorbisReader::open(const SPtr<DataStream>& stream, AudioDataInfo& info, UINT32 offset)
 	{
 		if (stream == nullptr)
 			return false;

+ 4 - 4
Source/BansheeOpenAudio/Source/BsOAPlugin.cpp

@@ -8,7 +8,7 @@
 
 namespace BansheeEngine
 {
-	class BS_OA_EXPORT OAFactory : public AudioFactory
+	class OAFactory : public AudioFactory
 	{
 	public:
 		void startUp() override
@@ -23,14 +23,14 @@ namespace BansheeEngine
 	};
 
 	/**	Returns a name of the plugin. */
-	extern "C" BS_OA_EXPORT const char* getPluginName()
+	extern "C" const char* getPluginName()
 	{
 		static const char* pluginName = "OpenAudio";
 		return pluginName;
 	}
 
 	/**	Entry point to the plugin. Called by the engine when the plugin is loaded. */
-	extern "C" BS_OA_EXPORT void* loadPlugin()
+	extern "C" void* loadPlugin()
 	{
 		OAImporter* importer = bs_new<OAImporter>();
 		Importer::instance()._registerAssetImporter(importer);
@@ -39,7 +39,7 @@ namespace BansheeEngine
 	}
 
 	/**	Exit point of the plugin. Called by the engine before the plugin is unloaded. */
-	extern "C" BS_OA_EXPORT void unloadPlugin(OAFactory* instance)
+	extern "C" void unloadPlugin(OAFactory* instance)
 	{
 		bs_delete(instance);
 	}

+ 2 - 2
Source/BansheeOpenAudio/Source/BsOAWaveReader.cpp

@@ -24,7 +24,7 @@ namespace BansheeEngine
 			&& (header[8] == 'W') && (header[9] == 'A') && (header[10] == 'V') && (header[11] == 'E');
 	}
 
-	bool OAWaveReader::open(const SPtr<DataStream>& stream, AudioFileInfo& info, UINT32 offset)
+	bool OAWaveReader::open(const SPtr<DataStream>& stream, AudioDataInfo& info, UINT32 offset)
 	{
 		if (stream == nullptr)
 			return false;
@@ -51,7 +51,7 @@ namespace BansheeEngine
 		return (UINT32)mStream->read(samples, numSamples * mBytesPerSample);
 	}
 
-	bool OAWaveReader::parseHeader(AudioFileInfo& info)
+	bool OAWaveReader::parseHeader(AudioDataInfo& info)
 	{
 		bool foundData = false;
 		while (!foundData)

+ 10 - 10
Source/BansheeOpenAudio/Source/BsOAOggVorbisWriter.cpp → Source/BansheeOpenAudio/Source/BsOggVorbisWriter.cpp

@@ -1,4 +1,4 @@
-#include "BsOAOggVorbisWriter.h"
+#include "BsOggVorbisWriter.h"
 #include "BsDataStream.h"
 #include "BsAudioUtility.h"
 
@@ -17,16 +17,16 @@ namespace BansheeEngine
 		mBufferOffset += length;						\
 	}
 
-	OAOggVorbisWriter::OAOggVorbisWriter()
+	OggVorbisWriter::OggVorbisWriter()
 		:mBufferOffset(0), mNumChannels(0), mBitDepth(0), mClosed(true)
 	{ }
 
-	OAOggVorbisWriter::~OAOggVorbisWriter()
+	OggVorbisWriter::~OggVorbisWriter()
 	{
 		close();
 	}
 
-	bool OAOggVorbisWriter::open(std::function<void(UINT8*, UINT32)> writeCallback, UINT32 sampleRate, UINT32 bitDepth, 
+	bool OggVorbisWriter::open(std::function<void(UINT8*, UINT32)> writeCallback, UINT32 sampleRate, UINT32 bitDepth, 
 		UINT32 numChannels)
 	{
 		mNumChannels = numChannels;
@@ -78,7 +78,7 @@ namespace BansheeEngine
 		return true;
 	}
 
-	void OAOggVorbisWriter::write(UINT8* samples, UINT32 numSamples)
+	void OggVorbisWriter::write(UINT8* samples, UINT32 numSamples)
 	{
 		static const UINT32 WRITE_LENGTH = 1024;
 
@@ -155,7 +155,7 @@ namespace BansheeEngine
 		}
 	}
 
-	void OAOggVorbisWriter::writeBlocks()
+	void OggVorbisWriter::writeBlocks()
 	{
 		while (vorbis_analysis_blockout(&mVorbisState, &mVorbisBlock) == 1)
 		{
@@ -180,7 +180,7 @@ namespace BansheeEngine
 		}
 	}
 
-	void OAOggVorbisWriter::flush()
+	void OggVorbisWriter::flush()
 	{
 		if (mBufferOffset > 0 && mWriteCallback != nullptr)
 			mWriteCallback(mBuffer, mBufferOffset);
@@ -188,7 +188,7 @@ namespace BansheeEngine
 		mBufferOffset = 0;
 	}
 
-	void OAOggVorbisWriter::close()
+	void OggVorbisWriter::close()
 	{
 		if (mClosed)
 			return;
@@ -206,7 +206,7 @@ namespace BansheeEngine
 		mClosed = true;
 	}
 
-	UINT8* OAOggVorbisWriter::PCMToOggVorbis(UINT8* samples, const AudioFileInfo& info, UINT32& size)
+	UINT8* OggVorbisWriter::PCMToOggVorbis(UINT8* samples, const AudioDataInfo& info, UINT32& size)
 	{
 		struct EncodedBlock
 		{
@@ -229,7 +229,7 @@ namespace BansheeEngine
 
 		bs_frame_mark();
 
-		OAOggVorbisWriter writer;
+		OggVorbisWriter writer;
 		writer.open(writeCallback, info.sampleRate, info.bitDepth, info.numChannels);
 
 		writer.write(samples, info.numSamples);