#ifndef FMODSOUNDINPUT_H_
#define FMODSOUNDINPUT_H_

#include <vector>
#include <map>
#include <fmod.h>
#include <fmod_errors.h>
#include "DFunc/debug.h"
#include "Components/Component.h"
#include "System/FMod/FModSystem.h"

const std::string audio_output_filename("record_test.wav");

class FModSoundInput : public Component
{
	public:
		FModSoundInput();	//the audio processor component must be loaded first.
		void processEvent(Event *event);
		void update();
		void process();
		~FModSoundInput();
	private:
		void writeWavHeader(FMOD_SOUND *sound, int length);
		
		FILE 						*audio_fp_out;
		
		FMOD_SYSTEM 				*system;
		FMOD_CREATESOUNDEXINFO 		exinfo;
		FMOD_RESULT 				result;		//for error handling
		FMOD_SOUND 					*sound;
		unsigned int				datalength,
									soundlength;
};

#endif

