AudioCommon: Initialize before HW

This commit is contained in:
Bonta-kun
2021-03-22 00:06:44 +01:00
parent bc4d0b3ef8
commit 66e39de1ab
4 changed files with 12 additions and 9 deletions

View File

@ -15,7 +15,6 @@
#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;
@ -66,13 +65,11 @@ void InitSoundStream()
g_sound_stream = std::make_unique<NullSound>();
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());
void PostInitSoundStream()
{
// This needs to be called after AudioInterface::Init where input sample rates are set
UpdateSoundStream();
SetSoundStreamRunning(true);