SDL_UnbindAudioStreams(3)

✨ SDL_UnbindAudioStreams ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual πŸ’– today's main character is SDL_UnbindAudioStreams(3) and she is literally here to set your audio streams free.


🌸 NAME 🌸

SDL_UnbindAudioStreams β€” unbind a whole list of audio streams from their audio devices. like, a mass un-linkening. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_audio.h>

void SDL_UnbindAudioStreams(SDL_AudioStream * const *streams, int num_streams);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜•: you hand this function an array of streams, and it unhooks every single one of them from whatever audio device they were vibing on.

and the best part? the streams being unbound do not all have to be on the same device. mix and match, bestie, it does not care.

but for the streams that are on the same device β€” those get unbound atomically. which means data stops flowing through all the unbound streams on that same device at the exact same time. no awkward in-between state, no half-unbound limbo, just a clean synchronized exit. it's giving ✨choreography✨.

oh and if you try to unbind a stream that isn't bound to a device at all? totally fine. that's a legal no-op β€” it just shrugs and moves on. no error, no drama, no nothing. πŸ’…


🌈 FUNCTION PARAMETERS 🌈

  • streams β€” an array of audio streams to unbind. this one is chill: it Can be NULL or contain NULL. yeah, it's that unbothered.
  • num_streams β€” the number of streams listed in the streams array. just tell her how many you brought to the party. πŸ”₯

🧚 THREAD SAFETY 🧚

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


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on anything older… girl, upgrade. 😭


πŸ’œ SEE ALSO πŸ’œ

  • SDL_BindAudioStreams(3) β€” the other half of the story, the one that does the binding. they're a matched set, iykyk. 🫢

and that's the whole page, bestie!! πŸŽ€ this little gem comes to you from Simple Directmedia Layer, sitting pretty at SDL 3.4.18 β€” so if you ever need to cite your source, that's the one. now go forth and unbind responsibly πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from