ppsspp/Windows/WindowsAudio.h
Henrik Rydgård 828036f87b WASAPI: Survive switching to a mono device. Fixes #14591
It's a little flaky whether it tries to switch or not, but you can at
least use Windows' device selector to switch back and forth.

Should maybe also add an option to not follow the default device... Not
sure.
2021-07-10 01:22:34 +02:00

23 lines
691 B
C++

#pragma once
#include "Common/CommonWindows.h"
#include "Core/Config.h"
#include "Core/ConfigValues.h"
// Always 2 channels.
typedef int(*StreamCallback)(short *buffer, int numSamples, int bits, int rate);
// Note that the backend may override the passed in sample rate. The actual sample rate
// should be returned by GetSampleRate though.
class WindowsAudioBackend {
public:
WindowsAudioBackend() {}
virtual ~WindowsAudioBackend() {}
virtual bool Init(HWND window, StreamCallback _callback, int sampleRate) = 0;
virtual void Update() {} // Doesn't have to do anything
virtual int GetSampleRate() = 0;
};
// Factory
WindowsAudioBackend *CreateAudioBackend(AudioBackendType type);