diff options
| author | Chris Burgener <christhecoolist@gmail.com> | 2016-07-01 01:03:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-01 01:03:14 -0400 |
| commit | fcbb39d236d26e35f8698000b041470d1d8f6dbc (patch) | |
| tree | 1a29b5111cc8f1de6edb96963e2588224b0851e5 /Source/Core/AudioCommon/WaveFile.cpp | |
| parent | 046c96f1b825756ce598f9c84b82f204d66b4aab (diff) | |
| parent | 76abf1f727f7b17da49e99f1ea3d40d77a2eaabf (diff) | |
Merge pull request #3972 from RisingFog/merge_addstereosamples
Remove AddStereoSamples function
Diffstat (limited to 'Source/Core/AudioCommon/WaveFile.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/WaveFile.cpp | 36 |
1 files changed, 3 insertions, 33 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; } |
