SDL_BindAudioStreams(3)
โจ SDL_BindAudioStreams โ the girlies are getting bound ๐
okay bestie, welcome to the SDL3 FUNCTIONS</p> corner of the man pages. today's main character is SDL_BindAudioStreams, and she is literally about to marry a whole list of audio streams to one audio device. periodt.
๐ธ NAME ๐ธ
SDL_BindAudioStreams โ bind a list of audio streams to an audio device. no cap, that's the whole job.
๐ SYNOPSIS ๐
#include <SDL3/SDL_audio.h>
bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream * const *streams, int num_streams);
like. look at her. three little args and she's changing lives ๐
๐ฆ DESCRIPTION ๐ฆ
so here's the tea, bestie. once streams are bound, audio data will flow through any of them. and it depends on what kind of device you're working with:
- for a playback device, data for all bound streams gets mixed together and fed to the device. it's giving group project but everyone actually shows up. ๐ฅ
- for a recording device, a copy of the recorded data is handed to each bound stream. everyone gets their own lil slice, no fighting. ๐
also important: audio streams can only be bound to an open device. and this operation is atomic โ every stream bound in the same call starts processing at the same time, so they can stay in sync (iykyk, sync is everything). and the atomic thing means: either all streams get bound, or none of them do. it's all or nothing, babe. ๐
โ ๏ธ it is an error to bind an already-bound stream. you must explicitly unbind it first. do not try to double-book her, she will not allow it.
binding a stream to a device will set its output format for playback devices, and its input format for recording devices, so they match the device's settings. but here's the fun part โ the caller is totally welcome to change the other end of the stream's format at any time with SDL_SetAudioStreamFormat(). slay, you have options. โจ
and if the other end of the stream's format has never been set (meaning the audio stream was created with a NULL audio spec), this function will set it to match the device end's format. she'll just handle it for you, because she's thoughtful like that. ๐ซถ
๐ FUNCTION PARAMETERS ๐
devidโ an audio device to bind a stream to. the one, the only, the destination ๐streamsโ an array of audio streams to bind. bring the whole squad.num_streamsโ number streams listed in thestreamsarray. yes bestie, she's counting. ๐งฎ
โญ RETURN VALUE โญ
returns true on success or false on failure. and if it flops? call SDL_GetError() for more information, she'll tell you what went wrong. no secrets between us. ๐ญ
๐ THREAD SAFETY ๐
it is safe to call this function from any thread. go off, queen. run it everywhere. ๐
๐ AVAILABILITY ๐
this function is available since SDL 3.2.0. so if you're on something older... bestie, upgrade. it's giving ancient. ๐
๐ SEE ALSO ๐
SDL_BindAudioStreams(3)โ yes she's linking herself, iconic behavior honestlySDL_UnbindAudioStream(3)โ the breakup arc, when you need to let her goSDL_GetAudioStreamDevice(3)โ for when you forgot which device she's bound to ๐
okay that's the whole page, and that's the vibe check passed. ๐ this lil masterpiece comes to you straight from Simple Directmedia Layer, version SDL 3.4.18 โ go bind responsibly, bestie, and remember: all streams or none. periodt. ๐โจ๐ฆ๐ธ๐ซถ
๐ฆ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms