SDL_GetAudioDeviceChannelMap(3)

πŸ’– NAME πŸ’–

SDL_GetAudioDeviceChannelMap β€” bestie, this one grabs the current channel map of an audio device for you 🎧✨


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_audio.h>

int * SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so first things first: channel maps are optional. like, genuinely optional. most things do not need them at all β€” instead you just pass your data in the [order that SDL expects](CategoryAudio#channel-layouts) and you're golden, no cap. πŸ’…

and here's the thing, audio devices usually have no remapping applied at all. when that's the case this function hands you back NULL, and bestie listen β€” that is not an error. it's just the default vibe. do not panic. πŸ™ˆ


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • devid β€” the instance ID of the device you wanna query. that's the one. πŸ‘‘
  • count β€” on output, this gets set to the number of channels in the map. it can be NULL. yeah, she's flexible like that. ✨

⭐ RETURN VALUE ⭐

you get back an array of the current channel mapping, with as many elements as the current output spec's channels β€” or NULL if it's the default. 🫢

⚠️ when you're done with it, free it with SDL_free()! don't leave her hanging, that's a leak and leaks are not the vibe. 😭

πŸ”₯ THREAD SAFETY πŸ”₯

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


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. if you're on anything older, she simply does not exist yet, sorry babe. πŸ’€


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie!! this little icon was brought to you by Simple Directmedia Layer, rockin' SDL 3.4.18 β€” no date on this one, but the whole SDL3 functions crew says hiii. mwah πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from