diff options
| author | sowens99 <seanowens@comcast.net> | 2021-10-03 16:40:59 -0400 |
|---|---|---|
| committer | sowens99 <seanowens@comcast.net> | 2021-10-03 18:20:01 -0400 |
| commit | 1d5d896eaa7299afbc9a3a19fa27a9063b2b4646 (patch) | |
| tree | d30a1200cbbe2b99d7b890437134db8f890b29cc /Source/Core/AudioCommon/AudioCommon.cpp | |
| parent | 207c931a04c8e2629a735bc2b3f36b5c89365ca7 (diff) | |
Add timecode to dspdump and dtkdump
Match the same formatting present in framedump filenames.
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index d3bdcde445..65b5f92ed4 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -2,6 +2,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "AudioCommon/AudioCommon.h" + +#include <fmt/chrono.h> +#include <fmt/format.h> + #include "AudioCommon/AlsaSoundStream.h" #include "AudioCommon/CubebStream.h" #include "AudioCommon/Mixer.h" @@ -201,8 +205,15 @@ void SendAIBuffer(const short* samples, unsigned int num_samples) void StartAudioDump() { - std::string audio_file_name_dtk = File::GetUserPath(D_DUMPAUDIO_IDX) + "dtkdump.wav"; - std::string audio_file_name_dsp = File::GetUserPath(D_DUMPAUDIO_IDX) + "dspdump.wav"; + std::time_t start_time = std::time(nullptr); + + std::string path_prefix = File::GetUserPath(D_DUMPAUDIO_IDX) + SConfig::GetInstance().GetGameID(); + + std::string base_name = + fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, *std::localtime(&start_time)); + + const std::string audio_file_name_dtk = fmt::format("{}_dtkdump.wav", base_name); + const std::string audio_file_name_dsp = fmt::format("{}_dspdump.wav", base_name); File::CreateFullPath(audio_file_name_dtk); File::CreateFullPath(audio_file_name_dsp); g_sound_stream->GetMixer()->StartLogDTKAudio(audio_file_name_dtk); |
