SDL_AudioDeviceEvent(3type)
π SDL_AudioDeviceEvent π
okay bestie, welcome to the SDL_AudioDeviceEvent page from the SDL3 DATATYPES era of the SDL3 manual β this is the one that tells you when audio devices show up, dip out, or switch up their whole format. π§β¨
β¨ NAME β¨
SDL_AudioDeviceEvent β the audio device event structure, aka all the event.adevice.* goodness π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_events.h>
typedef struct SDL_AudioDeviceEvent
{
SDL_EventType type; /**< SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_AudioDeviceID which; /**< SDL_AudioDeviceID for the device being added or removed or changing */
bool recording; /**< false if a playback device, true if a recording device. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
} SDL_AudioDeviceEvent;
π DESCRIPTION π
so like. the tea is that SDL is gonna hit you with a SDL_EVENT_AUDIO_DEVICE_ADDED event for every single device it discovers during initialization. every one. no skipping. π
and after that? that's it, that's the whole hotplug situation β this event only rolls up again when a device gets hotplugged while your program is actually running. main character device energy only. π
π AVAILABILITY π
this struct has been around since SDL 3.2.0. iconic behavior, fr fr. π
that's the whole page, bestie β go forth and handle those device events. mwah π
this has been Simple Directmedia Layer's SDL 3.4.18, SDL_AudioDeviceEvent(3type), signing off πβ¨ bye babes π¦
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms