diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-07-05 11:37:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-05 11:37:30 +0200 |
| commit | de3d1344d5ed939faedae9c19e2e340a83038aba (patch) | |
| tree | 40d2efd3dbe7c8ad2d7303539a7a48264be00005 /Source/Core/AudioCommon/WaveFile.h | |
| parent | d625c612c4a40a8c8db3d90b313f5643aec9c890 (diff) | |
| parent | 4234b25682ddfab6018c3c7bf410e568f527b1cd (diff) | |
Merge pull request #10762 from CasualPokePlayer/fix_slow_audio_desyncs
Reduce gradual audio desyncing in dumps and apply the correct sample rate for GameCube audio
Diffstat (limited to 'Source/Core/AudioCommon/WaveFile.h')
| -rw-r--r-- | Source/Core/AudioCommon/WaveFile.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/Core/AudioCommon/WaveFile.h b/Source/Core/AudioCommon/WaveFile.h index e95ed8eb73..350e1da9af 100644 --- a/Source/Core/AudioCommon/WaveFile.h +++ b/Source/Core/AudioCommon/WaveFile.h @@ -30,24 +30,28 @@ public: WaveFileWriter(WaveFileWriter&&) = delete; WaveFileWriter& operator=(WaveFileWriter&&) = delete; - bool Start(const std::string& filename, unsigned int HLESampleRate); + bool Start(const std::string& filename, u32 sample_rate_divisor); void Stop(); void SetSkipSilence(bool skip) { skip_silence = skip; } - void AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate, int l_volume, - int r_volume); // big endian + // big endian + void AddStereoSamplesBE(const short* sample_data, u32 count, u32 sample_rate_divisor, + int l_volume, int r_volume); u32 GetAudioSize() const { return audio_size; } private: static constexpr size_t BUFFER_SIZE = 32 * 1024; - File::IOFile file; - bool skip_silence = false; - u32 audio_size = 0; - std::array<short, BUFFER_SIZE> conv_buffer{}; void Write(u32 value); void Write4(const char* ptr); + + File::IOFile file; std::string basename; - int current_sample_rate; - int file_index = 0; + u32 file_index = 0; + u32 audio_size = 0; + + u32 current_sample_rate_divisor; + std::array<short, BUFFER_SIZE> conv_buffer{}; + + bool skip_silence = false; }; |
