2017-06-27 09:46:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Common/CommonWindows.h"
|
|
|
|
#include "Core/ConfigValues.h"
|
|
|
|
|
2023-03-24 12:59:27 +00:00
|
|
|
// Always 2 channels, 16-bit audio.
|
|
|
|
typedef int (*StreamCallback)(short *buffer, int numSamples, int rate);
|
2017-06-27 09:46:10 +00:00
|
|
|
|
|
|
|
// Note that the backend may override the passed in sample rate. The actual sample rate
|
|
|
|
// should be returned by GetSampleRate though.
|
|
|
|
class WindowsAudioBackend {
|
|
|
|
public:
|
|
|
|
virtual ~WindowsAudioBackend() {}
|
|
|
|
virtual bool Init(HWND window, StreamCallback _callback, int sampleRate) = 0;
|
2023-03-24 09:40:10 +00:00
|
|
|
virtual int GetSampleRate() const = 0;
|
2017-06-27 09:46:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Factory
|
|
|
|
WindowsAudioBackend *CreateAudioBackend(AudioBackendType type);
|