SDL_IsAudioDevicePhysical(3)

✨ SDL_IsAudioDevicePhysical ✨

okay so bestie, we're in the SDL3 FUNCTIONS corner of the SDL_IsAudioDevicePhysical(3) manual, and this one is genuinely a lil vibe check for your audio devices πŸ’–


🌸 NAME 🌸

SDL_IsAudioDevicePhysical β€” figure out if an audio device is physical (aka the real hardware) instead of logical (aka the lil made-up ones). πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_audio.h>

bool SDL_IsAudioDevicePhysical(SDL_AudioDeviceID devid);

πŸ¦‹ DESCRIPTION πŸ¦‹

so an SDL_AudioDeviceID that represents actual physical hardware is a physical device β€” there's literally one for every single piece of hardware SDL can see. ✨

Logical devices are the ones you make by calling SDL_OpenAudioDevice or SDL_OpenAudioDeviceStream. And the way that each one is associated with a physical device? cute. But here's the tea: there can be any number of logical devices hanging off of one physical device. not one, not two, any number. no cap. 😭

For the most part, logical and physical IDs are interchangeable β€” like, if you try to open a logical device, SDL understands to assign that effort to the underlying physical device, etc. etc. πŸ’« But sometimes you just wanna know if some arbitrary device ID is physical or logical, y'know? That's exactly what this function reports. slay.

⚠️ ok important: this function may return either true or false for invalid device IDs. so don't come for it expecting a clean answer on garbage input, bestie. πŸ™ˆ

πŸ“ FUNCTION PARAMETERS πŸ“

  • devid β€” the device ID you wanna query. that's it, that's the whole parameter. 🫢

πŸ’œ RETURN VALUE πŸ’œ

Returns true if devid is a physical device, and false if it's logical. simple as. ✨


πŸ”₯ THREAD SAFETY πŸ”₯

It is safe to call this function from any thread. go off, queen. πŸ‘‘


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. ⭐


and that's the whole page, no notes πŸ’… brought to you by Simple Directmedia Layer, straight from SDL 3.4.18 β€” SDL_IsAudioDevicePhysical(3), signing off, mwah πŸŽ€πŸ’–

πŸ“¦ where this page comes from