From 76abf1f727f7b17da49e99f1ea3d40d77a2eaabf Mon Sep 17 00:00:00 2001 From: Chris Burgener Date: Thu, 30 Jun 2016 20:43:59 -0400 Subject: [PATCH] Remove AddStereoSample function --- Source/Core/AudioCommon/WaveFile.cpp | 36 +++------------------------- Source/Core/AudioCommon/WaveFile.h | 2 -- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/Source/Core/AudioCommon/WaveFile.cpp b/Source/Core/AudioCommon/WaveFile.cpp index 3fb073f777..5634bd4157 100644 --- a/Source/Core/AudioCommon/WaveFile.cpp +++ b/Source/Core/AudioCommon/WaveFile.cpp @@ -94,31 +94,6 @@ void WaveFileWriter::Write4(const char* ptr) file.WriteBytes(ptr, 4); } -void WaveFileWriter::AddStereoSamples(const short* sample_data, u32 count, int sample_rate) -{ - if (!file) - PanicAlertT("WaveFileWriter - file not open."); - - if (skip_silence) - { - bool all_zero = true; - - for (u32 i = 0; i < count * 2; i++) - { - if (sample_data[i]) - all_zero = false; - } - - if (all_zero) - return; - } - - CheckSampleRate(sample_rate); - - file.WriteBytes(sample_data, count * 4); - audio_size += count * 4; -} - void WaveFileWriter::AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate) { if (!file) @@ -148,14 +123,6 @@ void WaveFileWriter::AddStereoSamplesBE(const short* sample_data, u32 count, int conv_buffer[2 * i + 1] = Common::swap16((u16)sample_data[2 * i]); } - CheckSampleRate(sample_rate); - - file.WriteBytes(conv_buffer.data(), count * 4); - audio_size += count * 4; -} - -void WaveFileWriter::CheckSampleRate(int sample_rate) -{ if (sample_rate != current_sample_rate) { Stop(); @@ -165,4 +132,7 @@ void WaveFileWriter::CheckSampleRate(int sample_rate) Start(filename.str(), sample_rate); current_sample_rate = sample_rate; } + + file.WriteBytes(conv_buffer.data(), count * 4); + audio_size += count * 4; } diff --git a/Source/Core/AudioCommon/WaveFile.h b/Source/Core/AudioCommon/WaveFile.h index 761f205722..58028e84b4 100644 --- a/Source/Core/AudioCommon/WaveFile.h +++ b/Source/Core/AudioCommon/WaveFile.h @@ -30,7 +30,6 @@ public: void Stop(); void SetSkipSilence(bool skip) { skip_silence = skip; } - void AddStereoSamples(const short* sample_data, u32 count, int sample_rate); void AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate); // big endian u32 GetAudioSize() const { return audio_size; } private: @@ -42,7 +41,6 @@ private: std::array conv_buffer{}; void Write(u32 value); void Write4(const char* ptr); - void CheckSampleRate(int sample_rate); std::string basename; int current_sample_rate; int file_index = 0;