SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE(3)

πŸ’– SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, where we're talking about SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE(3) β€” the hint that tells ALSA which audio device to grab when you're being vague and just asking for "default". no cap, this one's short and sweet. πŸŽ€


✨ NAME ✨

SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE β€” specify the default ALSA audio device name. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE "SDL_AUDIO_ALSA_DEFAULT_DEVICE"

yes, the macro name and the string are different β€” the macro is SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE and the actual string value is "SDL_AUDIO_ALSA_DEFAULT_DEVICE". copy them exactly, don't freestyle. πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” this variable is a specific audio device to open when the "default" audio device is used. like, you know how everyone's just yelling "default!!" into the void? this hint is you going "actually, this one, bestie." πŸ‘‘

but listen, there's a catch, and it's giving plot twist 😭:

  • this hint gets ignored when you're opening the default playback device, if SDL_HINT_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE is set
  • this hint also gets ignored when you're opening the default recording device, if SDL_HINT_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE is set

so basically if the more specific hint shows up, this one steps aside like the polite icon it is. 🫢

⏰ timing check!! this hint should be set before an audio device is opened. set it late and it's giving nothing, fr fr.

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. so if you're on something older, sorry babe, it's not you, it's the version. πŸ’€


⭐ SEE ALSO ⭐

go read those two next, they're the ones that override this one and they ate. πŸ”₯


and that's the whole page, periodt. πŸŽ€ this one came to you from Simple Directmedia Layer, rocking SDL 3.4.18 β€” mwah, ily, go set your hint before you open that device. πŸ’œ

πŸ“¦ where this page comes from