SDL_HINT_AUD...E_STREAM_NAME(3)

✨ SDL_HINT_AUDIO_DEVICE_STREAM_NAME(3) ✨

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_HINT_AUDIO_DEVICE_STREAM_NAME πŸ’– this is a hint, it's a lil string you set, and it tells the OS what to call your audio. iconic behavior, honestly.


🌸 NAME 🌸

SDL_HINT_AUDIO_DEVICE_STREAM_NAME β€” Specify an audio stream name for an audio device. that's it, that's the whole job, and she does it flawlessly πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_hints.h>

#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME"

yes the macro name and the string value are different and yes you have to use the right one, do not come for me πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

so some audio backends (like PulseAudio, for example) literally let you describe your audio stream. it's giving "hello OS, this is what I am." and among other things, that description might pop up in a system control panel where the user can adjust the volume of specific audio streams instead of just grabbing one giant master volume slider and yanking it. way more civilized, fr fr ✨

this hint is how you transmit that info to the OS. the contents get used while opening an audio device. so you wanna pass a string that describes what your program is playing β€” "audio stream" is probably sufficient in many cases ngl, but it's also useful for something like "team chat" if you've got a headset playing VoIP audio separately. see the vision? πŸ‘‘

if you set this to "" or just leave it unset, SDL will use a reasonable default: "audio stream" or something similar. so no pressure, she's got you 🫢

⚠️ okay important note, don't skip this one: even though we keep saying "audio streams", this is an OS-level concept. so it applies to a physical audio device here β€” not an SDL_AudioStream, and not an SDL logical audio device. do not confuse the girlies, they are different πŸ’€

also: this hint should be set before an audio device is opened. timing matters, bestie, don't be late to your own vibe check 😭


⭐ AVAILABILITY ⭐

this hint is available since SDL 3.2.0. so if you're on anything older, sorry babe, she's not there yet πŸ™ˆ


and that's the page!! tysm for reading, mwah πŸ’–

sign-off moment: this came to you from Simple Directmedia Layer, SDL 3.4.18, page SDL_HINT_AUD...E_STREAM_NAME(3). go forth and name your streams, you're doing amazing sweetie πŸŒˆπŸŽ€
πŸ“¦ where this page comes from