From fff570012ff375927ac913dabe39a016600ef8ec Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Sat, 26 Jan 2019 22:20:21 +0800 Subject: [PATCH] audio_core: Dump audio frames and samples This is tested to work with all three current methods - HLE, LLE and multithread LLE. --- src/audio_core/dsp_interface.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/audio_core/dsp_interface.cpp b/src/audio_core/dsp_interface.cpp index 1b79e82bb..b6e74b82c 100644 --- a/src/audio_core/dsp_interface.cpp +++ b/src/audio_core/dsp_interface.cpp @@ -7,6 +7,8 @@ #include "audio_core/sink.h" #include "audio_core/sink_details.h" #include "common/assert.h" +#include "core/core.h" +#include "core/dumping/backend.h" #include "core/settings.h" namespace AudioCore { @@ -41,6 +43,10 @@ void DspInterface::OutputFrame(StereoFrame16& frame) { return; fifo.Push(frame.data(), frame.size()); + + if (Core::System::GetInstance().VideoDumper().IsDumping()) { + Core::System::GetInstance().VideoDumper().AddAudioFrame(frame); + } } void DspInterface::OutputSample(std::array sample) { @@ -48,6 +54,10 @@ void DspInterface::OutputSample(std::array sample) { return; fifo.Push(&sample, 1); + + if (Core::System::GetInstance().VideoDumper().IsDumping()) { + Core::System::GetInstance().VideoDumper().AddAudioSample(sample); + } } void DspInterface::OutputCallback(s16* buffer, std::size_t num_frames) {