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 π
SDL_GetAudioStreamAvailable(3)SDL_GetAudioStreamData(3)SDL_GetAudioStreamQueued(3)SDL_PutAudioStreamData(3)
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
- 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