Shipwright/libultraship/libultraship/AudioPlayer.h
David Chavez dbc4d8199e
Feature: Allow choosing audio backend (#1588)
* Fix X11 being searched for on macOS

* Add ability to switch audio backends

* Fix issues with c arrays of std dynamic size items

* Fix old uses of sizeof()

* Remove current selected option from list

* Don’t show items if we only have one option
2022-09-26 19:48:47 -04:00

25 lines
470 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"
#endif
#include "SDLAudioPlayer.h"