ppsspp/UI/AudioCommon.cpp
Henrik Rydgård 72ab6cd0bc libretro: Bypass PPSSPP's resampler, since libretro already has one
Hopefully, this will fix the reported bad audio performance and
behavior. Running two speed-compensating resamplers in a row can't be a good thing.
2023-03-24 18:52:41 +01:00

32 lines
791 B
C++

#include "Common/System/System.h"
#include "Core/HW/StereoResampler.h" // TODO: doesn't belong in Core/HW...
#include "UI/AudioCommon.h"
StereoResampler g_resampler;
// numFrames is number of stereo frames.
// This is called from *outside* the emulator thread.
int __AudioMix(int16_t *outstereo, int numFrames, int sampleRate) {
return g_resampler.Mix(outstereo, numFrames, false, sampleRate);
}
void System_AudioGetDebugStats(char *buf, size_t bufSize) {
if (buf) {
g_resampler.GetAudioDebugStats(buf, bufSize);
} else {
g_resampler.ResetStatCounters();
}
}
void System_AudioClear() {
g_resampler.Clear();
}
void System_AudioPushSamples(const int32_t *audio, int numSamples) {
if (audio) {
g_resampler.PushSamples(audio, numSamples);
} else {
g_resampler.Clear();
}
}