SDL_GetAudioStreamProperties(3)

πŸ’– SDL_GetAudioStreamProperties πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one's literally called SDL_GetAudioStreamProperties and it's giving property-hunting main character energy πŸŽ€


✨ NAME ✨

SDL_GetAudioStreamProperties β€” get the properties associated with an audio stream. that's it, that's the gig πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_audio.h>

SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream *stream);

✨ DESCRIPTION ✨

so here's the tea 🍡 β€” your app can hang literally any data it wants on here. it's your little properties bag, do what you want with it. BUT SDL itself actually understands these ones, so pay attention bestie:

  • SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN β€” if it's true (which is the default, no cap), the stream gets automatically cleaned up when the audio subsystem quits. if you set it to false, the streams will persist beyond that πŸ‘€. this property is ignored for streams created through SDL_OpenAudioDeviceStream() β€” those will always be cleaned up, periodt. and fyi, streams that aren't cleaned up will still be unbound from devices when the audio subsystem quits. also this property was added in SDL 3.4.0, so if you're on something older, it's not gonna know her 🫢

✨ FUNCTION PARAMETERS ✨

  • stream β€” the SDL_AudioStream you wanna query. the one you're curious about. your girl πŸ¦‹

✨ RETURN VALUE ✨

returns a valid property ID on success, or 0 on failure 😭. if it flops, call SDL_GetError() for more info β€” she'll tell you what went wrong, fr fr.


✨ THREAD SAFETY ✨

it is safe to call this function from any thread. go off, queen πŸ‘‘, no locking drama required.


✨ AVAILABILITY ✨

this function is available since SDL 3.2.0. iconic behavior honestly ⭐


πŸ’€ reminder bestie: keep the property names exactly as written, they're case-sensitive and SDL does not play about that.

and that's the whole page, we ate and left no crumbs πŸ“

this lil slice of manual comes to you from Simple Directmedia Layer, version SDL 3.4.18, filed under SDL_GetAudioStreamProperties(3) β€” mwah, love u, go write some audio code πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from