SDL_ClearAudioStream(3)

πŸ’– SDL_ClearAudioStream πŸ’–

okay bestie, welcome to the SDL_ClearAudioStream(3) page, straight out of the SDL3 FUNCTIONS collection ✨ it's giving "audio stream, but make it empty" and honestly? iconic.


🌸 NAME 🌸

SDL_ClearAudioStream β€” clear any pending data in the stream πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_audio.h>

bool SDL_ClearAudioStream(SDL_AudioStream *stream);

like, that's the whole vibe. one include, one call, done. πŸ¦‹


✨ DESCRIPTION ✨

So here's the tea, bestie: this function drops any queued data from the stream. all of it. gone. poof. 🫢

Which means there will be nothing to read from the stream until more data gets added. not "a little bit", not "some leftovers" β€” nothing. it's a clean slate, a factory reset for your queue, the "not me deleting the whole group chat" energy but on purpose. πŸ’€


🧚 FUNCTION PARAMETERS 🧚

  • stream β€” the audio stream to clear. yes, that one. the one you're clearing. πŸ’œ

⭐ RETURN VALUE ⭐

Returns true on success, or false on failure 😭 and if it fails you gotta call SDL_GetError() for more info β€” she will tell you what went wrong, fr fr.


πŸ”₯ THREAD SAFETY πŸ”₯

It is safe to call this function from any thread. any thread. every thread. your thread, their thread, that one thread you forgot about. go off, queen πŸ‘‘


🌈 AVAILABILITY 🌈

This function has been available since SDL 3.2.0. so if you're on something older… no it isn't. upgrade bestie. πŸŽ€


πŸ‘‘ SEE ALSO πŸ‘‘

like, read those too, iykyk. πŸ“šβœ¨


lowkey important: this drops queued data only β€” it's not out here deleting your stream or anything dramatic like that. it just empties the queue. periodt. πŸ’…

and that's the page!! brought to you by Simple Directmedia Layer πŸ’– running SDL 3.4.18, mwah, slay, go clear some streams bestie πŸ¦‹πŸŒΈβœ¨

πŸ“¦ where this page comes from