Shipwright/libultraship/libultraship/AudioPlayer.h
2022-08-03 21:12:51 -04:00

25 lines
475 B
C++

#pragma once
#include "stdint.h"
namespace Ship {
class AudioPlayer {
public:
AudioPlayer() { };
virtual bool Init(void) = 0;
virtual int Buffered(void) = 0;
virtual int GetDesiredBuffered(void) = 0;
virtual void Play(const uint8_t* buf, uint32_t len) = 0;
constexpr int GetSampleRate() const { return 44100; }
};
}
#ifdef _WIN32
#include "WasapiAudioPlayer.h"
#elif defined(__linux)
#include "PulseAudioPlayer.h"
#else
#include "SDLAudioPlayer.h"
#endif