17struct SDL_AudioStream;
19PROMEKI_NAMESPACE_BEGIN
132 const AudioDesc &
desc()
const {
return _desc; }
200 SDL_AudioStream *_stream =
nullptr;
202 ClockDomain _clockDomain;
203 bool _configured =
false;
205 int64_t _totalBytesPushed = 0;
Manages an SDL3 audio output device for playback.
Definition sdlaudiooutput.h:64
virtual bool isPaused() const
Returns the current pause state.
Clock * createClock()
Returns a Clock whose time is driven by this output's consumed-byte counter.
bool isOpen() const
Returns true if the device is open and playing.
Definition sdlaudiooutput.h:104
SDLAudioOutput(ObjectBase *parent=nullptr)
Constructs an SDLAudioOutput.
virtual ClockDomain clockDomain() const
Returns the ClockDomain registered for the open SDL device.
Definition sdlaudiooutput.h:158
bool pushAudio(const PcmAudioPayload &payload)
Pushes uncompressed audio samples to the output stream.
virtual Error setPaused(bool paused)
Pauses or resumes the underlying SDL audio device.
bool open()
Opens the SDL audio device and starts playback.
virtual int64_t totalBytesPushed() const
Returns total float32 bytes pushed since open.
Definition sdlaudiooutput.h:146
void close()
Closes the audio device and frees resources.
const AudioDesc & desc() const
Returns the configured audio descriptor.
Definition sdlaudiooutput.h:132
virtual int queuedBytes() const
Returns the number of bytes currently queued.
bool configure(const AudioDesc &desc)
Configures the audio output format.