Engine → Audio → audio_backend.h
audio_backend
| Type | Class |
| Namespace | conjure::audio |
| Include File Path | engine/include/conjure/audio/audio_backend.h |
| Source File Path | engine/src/audio/audio_backend.cpp |
| API ↗ | Clips and decoding |
Syntax
Derived Classes
Classes that use this as a base
Constructors
| Access | Signature | Description |
|---|---|---|
| public | audio_backend(); |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | virtual ~audio_backend(); |
Functions
Public
enumerate_devices
enumerate_devices[[nodiscard]] virtual core::result<std::vector<audio_device_info>> enumerate_devices() const = 0;Playback devices this backend can open.
kind
kind[[nodiscard]] virtual audio_backend_kind kind() const noexcept = 0;Which implementation this is (never AUTO).
output_format
output_format[[nodiscard]] virtual audio_format output_format() const noexcept = 0;The format the callback is driven at after start() (the requested one; miniaudio converts to the device's native format internally).
start
start[[nodiscard]] virtual core::result<void> start(
const backend_desc &desc) = 0;Opens the device and starts driving desc.callback. Fails with INVALID_SETTINGS for a null callback or an unsupported sample rate, BACKEND_INIT_FAILED when the device cannot be opened and DEVICE_START_FAILED when it cannot be started; an unknown desc.deviceName is not an error (WARN, default device). A running backend is stopped first, and a failed start leaves the backend STOPPED.
state
state[[nodiscard]] virtual device_state state() const noexcept = 0;Atomic device state; readable from any thread.
stop
stopvirtual void stop() noexcept = 0;Stops the device; the callback is not running when this returns. Safe to call twice.
update
updatevirtual void update(
f32 deltaSeconds) = 0;Main thread, once per frame. null: advance the clock and render; miniaudio: poll.