diff --git a/Source/Core/AudioCommon/Src/Mixer.h b/Source/Core/AudioCommon/Src/Mixer.h index 90a6f06e25..89018c836b 100644 --- a/Source/Core/AudioCommon/Src/Mixer.h +++ b/Source/Core/AudioCommon/Src/Mixer.h @@ -70,7 +70,7 @@ public: virtual void StartLogAudio(const char *filename) { if (! m_logAudio) { m_logAudio = true; - g_wave_writer.Start(filename); + g_wave_writer.Start(filename, GetSampleRate()); g_wave_writer.SetSkipSilence(false); NOTICE_LOG(DSPHLE, "Starting Audio logging"); } else { diff --git a/Source/Core/AudioCommon/Src/SoundStream.h b/Source/Core/AudioCommon/Src/SoundStream.h index 165d58afc5..4b7cba9116 100644 --- a/Source/Core/AudioCommon/Src/SoundStream.h +++ b/Source/Core/AudioCommon/Src/SoundStream.h @@ -49,7 +49,7 @@ public: virtual void StartLogAudio(const char *filename) { if (! m_logAudio) { m_logAudio = true; - g_wave_writer.Start(filename); + g_wave_writer.Start(filename, m_mixer->GetSampleRate()); g_wave_writer.SetSkipSilence(false); NOTICE_LOG(DSPHLE, "Starting Audio logging"); } else { diff --git a/Source/Core/AudioCommon/Src/WaveFile.cpp b/Source/Core/AudioCommon/Src/WaveFile.cpp index c190ee38f7..a7ec387454 100644 --- a/Source/Core/AudioCommon/Src/WaveFile.cpp +++ b/Source/Core/AudioCommon/Src/WaveFile.cpp @@ -34,7 +34,7 @@ WaveFileWriter::~WaveFileWriter() Stop(); } -bool WaveFileWriter::Start(const char *filename) +bool WaveFileWriter::Start(const char *filename, unsigned int HLESampleRate) { if (!conv_buffer) conv_buffer = new short[BUF_SIZE]; @@ -64,7 +64,7 @@ bool WaveFileWriter::Start(const char *filename) Write(16); // size of fmt block Write(0x00020001); //two channels, uncompressed - const u32 sample_rate = SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPHLE ? 48000 : 32000; + const u32 sample_rate = SConfig::GetInstance().m_LocalCoreStartupParameter.bDSPHLE ? HLESampleRate : 32000; Write(sample_rate); Write(sample_rate * 2 * 2); //two channels, 16bit diff --git a/Source/Core/AudioCommon/Src/WaveFile.h b/Source/Core/AudioCommon/Src/WaveFile.h index fe4e7fe3d0..6176998d3b 100644 --- a/Source/Core/AudioCommon/Src/WaveFile.h +++ b/Source/Core/AudioCommon/Src/WaveFile.h @@ -43,7 +43,7 @@ public: WaveFileWriter(); ~WaveFileWriter(); - bool Start(const char *filename); + bool Start(const char *filename, unsigned int HLESampleRate); void Stop(); void SetSkipSilence(bool skip) { skip_silence = skip; }