libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
SDLAudioPlayer.h
Go to the documentation of this file.
1#pragma once
2#include "AudioPlayer.h"
3#include <SDL2/SDL.h>
4
5namespace Ship {
15class SDLAudioPlayer final : public AudioPlayer {
16 public:
22 }
24
30 int Buffered() override;
31
32 protected:
37 bool DoInit() override;
38
42 void DoClose() override;
43
49 void DoPlay(const uint8_t* buf, size_t len) override;
50
51 private:
52 SDL_AudioDeviceID mDevice = 0;
53 int32_t mNumChannels = 2;
54};
55} // namespace Ship
Abstract base class for platform-specific audio output backends.
Definition AudioPlayer.h:32
AudioPlayer implementation backed by SDL2's audio subsystem.
Definition SDLAudioPlayer.h:15
int Buffered() override
Returns the number of audio frames currently queued in the SDL audio device.
void DoClose() override
Closes the SDL audio device and releases its resources.
SDLAudioPlayer(AudioSettings settings)
Constructs an SDLAudioPlayer with the given audio settings.
Definition SDLAudioPlayer.h:21
void DoPlay(const uint8_t *buf, size_t len) override
Queues interleaved PCM samples to the SDL audio device.
bool DoInit() override
Opens the SDL audio device with the configured settings.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
Configuration parameters shared by all AudioPlayer backends.
Definition AudioPlayer.h:14