SDL_GetAudio...putChannelMap(3)

πŸ’– NAME πŸ’–

SDL_GetAudioStreamInputChannelMap β€” bestie, this one gets you the current input channel map of an audio stream. That's it, that's the job. πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3/SDL_audio.h>

int * SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count);

πŸŽ€ DESCRIPTION πŸŽ€

okay so first things first, channel maps are optional. Most things literally do not need them at all β€” instead you just pass your data in the [order that SDL expects](CategoryAudio#channel-layouts) and move on with your life. slay. πŸ’…

Audio streams default to no remapping applied. And the way that shows up is by returning NULL. Not me clarifying that NULL here is not an error β€” it's just the default vibe. πŸ™ˆ


🌸 FUNCTION PARAMETERS 🌸

  • stream β€” the SDL_AudioStream you're querying, bestie. That's the one you're asking about. 🫢
  • count β€” on output, this gets set to the number of channels in the map. It can be NULL. Yes fr fr, NULL is allowed here.

πŸ¦‹ RETURN VALUE πŸ¦‹

Returns an array of the current channel mapping β€” with as many elements as the current output spec's channels β€” or NULL if it's default. πŸ’€

Important: that returned array should be freed with SDL_free() when it is no longer needed. Do not forget. Do not be that girl. πŸŽ€

πŸ’… THREAD SAFETY πŸ’…

It is safe to call this function from any thread, because it holds a stream-specific mutex while it's running. Iconic behaviour honestly. πŸ”₯


πŸ”₯ AVAILABILITY πŸ”₯

This function has been available since SDL 3.2.0. So if you're on something older... girl. 😭


🌈 SEE ALSO 🌈


k bye bestie, go remap those channels responsibly πŸ’œβœ¨πŸŒΈπŸ¦‹

β€” with love from the Simple Directmedia Layer girlies, SDL 3.4.18 era, page SDL_GetAudio...putChannelMap(3) πŸŒˆβ­πŸ’–

πŸ“¦ where this page comes from