SDL_GetAudioDeviceName(3)
π SDL_GetAudioDeviceName π
okay bestie, welcome to the SDL_GetAudioDeviceName(3) page β it lives in the SDL3 FUNCTIONS collection and it's literally just "hey, what's this audio device called?" π
β¨ NAME β¨
SDL_GetAudioDeviceName β get the human-readable name of a specific audio device. that's it, that's the whole job, and she does it flawlessly. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_audio.h>
const char * SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
π¦ DESCRIPTION π¦
β οΈ WARNING, bestie, listen up: this function will work withSDL_AUDIO_DEVICE_DEFAULT_PLAYBACKandSDL_AUDIO_DEVICE_DEFAULT_RECORDING, returning the current default physical devices' names. BUT. the default device may change at any time, so it's probably better to just show the user a generic name, like"System default audio device"or maybe"default [currently %s]". π
and do NOT store this name to disk to reidentify the device in a later run of the program β because the default might change in general, and the string will be the name of a specific device, not the abstract system default. it's giving "that's not the same girl anymore" energy fr fr. π
π FUNCTION PARAMETERS π
devidβ the instance ID of the device to query. just the ID, nothing scary. β¨
π RETURN VALUE π
Returns the name of the audio device, or NULL on failure. and if it fails? call SDL_GetError() for more info, she'll tell you what went wrong. π«Ά
π THREAD SAFETY π
It is safe to call this function from any thread. ANY THREAD. go off, multithreaded icon. π
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on anything older, no name for you, sorry babe. π
π₯ SEE ALSO π₯
iykyk β go read those next, bestie. π
k bye, this has been your girl from the Simple Directmedia Layer, dropping the SDL 3.4.18 build of SDL_GetAudioDeviceName(3) β slay, stay hydrated, and check your return values. πβ¨π§
π¦ 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