Index: Source/Core/Common/Src/FileUtil.cpp
===================================================================
--- Source/Core/Common/Src/FileUtil.cpp	(revision 7095)
+++ Source/Core/Common/Src/FileUtil.cpp	(working copy)
@@ -640,6 +640,7 @@
 	static char HiresTexturesDir[MAX_PATH] = {0};
 	static char DumpDir[MAX_PATH] = {0};
 	static char DumpFramesDir[MAX_PATH] = {0};
+	static char DumpAudioDir[MAX_PATH] = {0};
 	static char DumpTexturesDir[MAX_PATH] = {0};
 	static char DumpDSPDir[MAX_PATH] = {0};
 	static char LogsDir[MAX_PATH] = {0};
@@ -684,6 +685,7 @@
 		snprintf(HiresTexturesDir, sizeof(HiresTexturesDir), "%s" HIRES_TEXTURES_DIR DIR_SEP, UserDir);
 		snprintf(DumpDir, sizeof(DumpDir), "%s" DUMP_DIR DIR_SEP, UserDir);
 		snprintf(DumpFramesDir, sizeof(DumpFramesDir), "%s" DUMP_FRAMES_DIR DIR_SEP, UserDir);
+		snprintf(DumpAudioDir, sizeof(DumpAudioDir), "%s" DUMP_AUDIO_DIR DIR_SEP, UserDir);
 		snprintf(DumpTexturesDir, sizeof(DumpTexturesDir), "%s" DUMP_TEXTURES_DIR DIR_SEP, UserDir);
 		snprintf(DumpDSPDir, sizeof(DumpDSPDir), "%s" DUMP_DSP_DIR DIR_SEP, UserDir);
 		snprintf(LogsDir, sizeof(LogsDir), "%s" LOGS_DIR DIR_SEP, UserDir);
@@ -733,6 +735,8 @@
 			return DumpDir;
 		case D_DUMPFRAMES_IDX:
 			return DumpFramesDir;
+		case D_DUMPAUDIO_IDX:
+			return DumpAudioDir;
 		case D_DUMPTEXTURES_IDX:
 			return DumpTexturesDir;
 		case D_DUMPDSP_IDX:
Index: Source/Core/Common/Src/CommonPaths.h
===================================================================
--- Source/Core/Common/Src/CommonPaths.h	(revision 7095)
+++ Source/Core/Common/Src/CommonPaths.h	(working copy)
@@ -83,6 +83,7 @@
 #define DUMP_DIR		"Dump"
 #define DUMP_TEXTURES_DIR	DUMP_DIR DIR_SEP "Textures"
 #define DUMP_FRAMES_DIR		DUMP_DIR DIR_SEP "Frames"
+#define DUMP_AUDIO_DIR		DUMP_DIR DIR_SEP "Audio"
 #define DUMP_DSP_DIR		DUMP_DIR DIR_SEP "DSP"
 #define LOGS_DIR		"Logs"
 #define MAIL_LOGS_DIR		LOGS_DIR DIR_SEP "Mail"
Index: Source/Core/Common/Src/FileUtil.h
===================================================================
--- Source/Core/Common/Src/FileUtil.h	(revision 7095)
+++ Source/Core/Common/Src/FileUtil.h	(working copy)
@@ -42,6 +42,7 @@
 	D_HIRESTEXTURES_IDX,
 	D_DUMP_IDX,
 	D_DUMPFRAMES_IDX,
+	D_DUMPAUDIO_IDX,
 	D_DUMPTEXTURES_IDX,
 	D_DUMPDSP_IDX,
 	D_LOGS_IDX,
Index: Source/Core/DolphinWX/Src/ConfigMain.cpp
===================================================================
--- Source/Core/DolphinWX/Src/ConfigMain.cpp	(revision 7095)
+++ Source/Core/DolphinWX/Src/ConfigMain.cpp	(working copy)
@@ -125,6 +125,7 @@
 EVT_RADIOBOX(ID_DSPENGINE, CConfigMain::AudioSettingsChanged)
 EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, CConfigMain::AudioSettingsChanged)
 EVT_CHECKBOX(ID_ENABLE_THROTTLE, CConfigMain::AudioSettingsChanged)
+EVT_CHECKBOX(ID_DUMP_AUDIO, CConfigMain::AudioSettingsChanged)
 EVT_CHOICE(ID_FREQUENCY, CConfigMain::AudioSettingsChanged)
 EVT_CHOICE(ID_BACKEND, CConfigMain::AudioSettingsChanged)
 EVT_SLIDER(ID_VOLUME, CConfigMain::AudioSettingsChanged)
@@ -396,6 +397,7 @@
 	VolumeText->SetLabel(wxString::Format(wxT("%d %%"), ac_Config.m_Volume));
 	EnableDTKMusic->SetValue(ac_Config.m_EnableDTKMusic ? true : false);
 	EnableThrottle->SetValue(ac_Config.m_EnableThrottle ? true : false);
+	DumpAudio->SetValue(ac_Config.m_DumpAudio ? true : false);
 	FrequencySelection->SetSelection(
 		FrequencySelection->FindString(wxString::Format(_("%d Hz"), ac_Config.sFrequency)));
 	// add backends to the list
@@ -710,6 +712,8 @@
 				wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
 	EnableThrottle = new wxCheckBox(AudioPage, ID_ENABLE_THROTTLE, _("Enable Audio Throttle"),
 				wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
+	DumpAudio = new wxCheckBox(AudioPage, ID_DUMP_AUDIO, _("Dump Audio"),
+				wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
 	VolumeSlider = new wxSlider(AudioPage, ID_VOLUME, 0, 1, 100,
 				wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
 	VolumeText = new wxStaticText(AudioPage, wxID_ANY, wxT(""),
@@ -725,6 +729,7 @@
 	sbAudioSettings->Add(DSPEngine, 0, wxALL | wxEXPAND, 5);
 	sbAudioSettings->Add(EnableDTKMusic, 0, wxALL, 5);
 	sbAudioSettings->Add(EnableThrottle, 0, wxALL, 5);
+	sbAudioSettings->Add(DumpAudio, 0, wxALL, 5);
 
 	wxStaticBoxSizer *sbVolume = new wxStaticBoxSizer(wxVERTICAL, AudioPage, _("Volume"));
 	sbVolume->Add(VolumeSlider, 1, wxLEFT|wxRIGHT, 13);
@@ -1066,6 +1071,7 @@
 	default:
 		ac_Config.m_EnableDTKMusic = EnableDTKMusic->GetValue();
 		ac_Config.m_EnableThrottle = EnableThrottle->GetValue();
+		ac_Config.m_DumpAudio = DumpAudio->GetValue();
 		ac_Config.sBackend = BackendSelection->GetStringSelection().mb_str();
 		long int frequency;
 		FrequencySelection->GetStringSelection().ToLong(&frequency);
Index: Source/Core/DolphinWX/Src/ConfigMain.h
===================================================================
--- Source/Core/DolphinWX/Src/ConfigMain.h	(revision 7095)
+++ Source/Core/DolphinWX/Src/ConfigMain.h	(working copy)
@@ -89,6 +89,7 @@
 		ID_ENABLE_HLE_AUDIO,
 		ID_ENABLE_DTK_MUSIC,
 		ID_ENABLE_THROTTLE,
+		ID_DUMP_AUDIO,
 		ID_FREQUENCY,
 		ID_BACKEND,
 		ID_VOLUME,
@@ -183,6 +184,7 @@
 	wxStaticText* VolumeText;    
 	wxCheckBox*	EnableDTKMusic;
 	wxCheckBox*	EnableThrottle;
+	wxCheckBox*	DumpAudio;
 	wxArrayString wxArrayBackends;
 	wxChoice*	BackendSelection;
 	wxChoice*	FrequencySelection;
Index: Source/Core/AudioCommon/Src/AlsaSoundStream.cpp
===================================================================
--- Source/Core/AudioCommon/Src/AlsaSoundStream.cpp	(revision 7095)
+++ Source/Core/AudioCommon/Src/AlsaSoundStream.cpp	(working copy)
@@ -73,6 +73,8 @@
 		{
 			ERROR_LOG(AUDIO, "writei fail: %s", snd_strerror(rc));
 		}
+		if (m_logAudio && m_mixer->IsPlaying())
+			g_wave_writer.AddStereoSamples((short *)mix_buffer, frames_to_deliver);
 	}
 	AlsaShutdown();
 	thread_data = 2;
Index: Source/Core/AudioCommon/Src/AOSoundStream.cpp
===================================================================
--- Source/Core/AudioCommon/Src/AOSoundStream.cpp	(revision 7095)
+++ Source/Core/AudioCommon/Src/AOSoundStream.cpp	(working copy)
@@ -50,6 +50,9 @@
 		soundCriticalSection.Enter();
 		ao_play(device, (char*)realtimeBuffer, numBytesToRender);
 		soundCriticalSection.Leave();
+		
+		if (m_logAudio && m_mixer->IsPlaying())
+			g_wave_writer.AddStereoSamples(realtimeBuffer, numBytesToRender >> 2);
 
 		soundSyncEvent.Wait();
 	}
Index: Source/Core/AudioCommon/Src/AudioCommonConfig.cpp
===================================================================
--- Source/Core/AudioCommon/Src/AudioCommonConfig.cpp	(revision 7095)
+++ Source/Core/AudioCommon/Src/AudioCommonConfig.cpp	(working copy)
@@ -33,6 +33,7 @@
 	file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
 	file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
 	file.Get("Config", "EnableJIT", &m_EnableJIT, true);
+	file.Get("Config", "DumpAudio", &m_DumpAudio, false);
 #if defined __linux__ && HAVE_ALSA
 	file.Get("Config", "Backend", &sBackend, BACKEND_ALSA);
 #elif defined __APPLE__
@@ -55,6 +56,7 @@
 	file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
 	file.Set("Config", "EnableThrottle", m_EnableThrottle);
 	file.Set("Config", "EnableJIT", m_EnableJIT);
+	file.Set("Config", "DumpAudio", m_DumpAudio);
 	file.Set("Config", "Backend", sBackend);
 	file.Set("Config", "Frequency", sFrequency);
 	file.Set("Config", "Volume", m_Volume);
Index: Source/Core/AudioCommon/Src/AudioCommonConfig.h
===================================================================
--- Source/Core/AudioCommon/Src/AudioCommonConfig.h	(revision 7095)
+++ Source/Core/AudioCommon/Src/AudioCommonConfig.h	(working copy)
@@ -36,6 +36,7 @@
 	bool m_EnableDTKMusic;
 	bool m_EnableThrottle;
 	bool m_EnableJIT;
+	bool m_DumpAudio;
 	int m_Volume;
 	std::string sBackend;
 	int sFrequency;
Index: Source/Core/AudioCommon/Src/AudioCommon.cpp
===================================================================
--- Source/Core/AudioCommon/Src/AudioCommon.cpp	(revision 7095)
+++ Source/Core/AudioCommon/Src/AudioCommon.cpp	(working copy)
@@ -16,6 +16,7 @@
 // http://code.google.com/p/dolphin-emu/
 
 #include "AudioCommon.h"
+#include "FileUtil.h"
 #include "Mixer.h"
 #include "NullSoundStream.h"
 #include "DSoundStream.h"
@@ -53,11 +54,12 @@
 			ac_Config.Update();
 			if (soundStream->Start())
 			{
-#if 0
-				// Start the sound recording
-				if (ac_Config.record)
-					soundStream->StartLogAudio(FULL_DUMP_DIR g_Config.recordFile);
-#endif
+				if (ac_Config.m_DumpAudio) {
+				  char audio_file_name[255];
+				  snprintf(audio_file_name, 255, "%saudiodump.wav", File::GetUserPath(D_DUMPAUDIO_IDX));
+				  soundStream->StartLogAudio(audio_file_name);
+				}
+
 				return soundStream;
 			}
 			PanicAlertT("Could not initialize backend %s.", backend.c_str());
@@ -76,10 +78,8 @@
 		if (soundStream) 
 		{
 			soundStream->Stop();
-#if 0
-			if (ac_Config.record)
+			if (ac_Config.m_DumpAudio)
 				soundStream->StopLogAudio();
-#endif
 			delete soundStream;
 			soundStream = NULL;
 		}
