summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/AudioCommon.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-08-29 16:42:57 +0200
committerJosJuice <josjuice@gmail.com>2020-09-06 15:37:20 +0200
commitbd44106fec950a962fa6150e0b76539504e89476 (patch)
treef5cb3922e4d6e57d78e2a4bf821c233407113e6c /Source/Core/AudioCommon/AudioCommon.cpp
parent1a1b89e7e87818d51a7b33d19245174ecdd78bb2 (diff)
AudioCommon: Get initial sample rates from AudioInterface
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
-rw-r--r--Source/Core/AudioCommon/AudioCommon.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp
index 467406dd9c..1330785ac8 100644
--- a/Source/Core/AudioCommon/AudioCommon.cpp
+++ b/Source/Core/AudioCommon/AudioCommon.cpp
@@ -15,6 +15,7 @@
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h"
#include "Core/ConfigManager.h"
+#include "Core/HW/AudioInterface.h"
// This shouldn't be a global, at least not here.
std::unique_ptr<SoundStream> g_sound_stream;
@@ -67,6 +68,12 @@ void InitSoundStream()
g_sound_stream->Init();
}
+ // Ideally these two calls would be done in AudioInterface::Init so that we don't
+ // need to have a dependency on AudioInterface here, but this has to be done
+ // after creating g_sound_stream (above) and before starting audio dumping (below)
+ g_sound_stream->GetMixer()->SetDMAInputSampleRate(AudioInterface::GetAIDSampleRate());
+ g_sound_stream->GetMixer()->SetStreamInputSampleRate(AudioInterface::GetAISSampleRate());
+
UpdateSoundStream();
SetSoundStreamRunning(true);