SDL_GetSilenceValueForFormat(3)
π SDL_GetSilenceValueForFormat(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_GetSilenceValueForFormat β she's a lil function with one job and she does it flawlessly, no cap. π
β¨ NAME β¨
SDL_GetSilenceValueForFormat β get the appropriate memset value for silencing an audio format.
like. she hands you the exact byte you need to make a whole audio buffer go quiet. that's it. that's the gig. π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_audio.h>
int SDL_GetSilenceValueForFormat(SDL_AudioFormat format);
π DESCRIPTION π
The value returned by this function can be used as the second argument to memset (or SDL_memset) to set an audio buffer in a specific format to silence.
so literally: you got a buffer, you got a format, you call her, you feed the result straight into memset as arg number two, and boom β silence. iconic behaviour honestly. π₯
π«Ά FUNCTION PARAMETERS π«Ά
formatβ the audio data format to query. that's the tea you're asking about, bestie. π
β RETURN VALUE β
Returns a byte value that can be passed to memset.
(one byte. tiny. powerful. the way that one little byte carries the whole silence agenda β¨)
π§ THREAD SAFETY π§
It is safe to call this function from any thread.
no locks, no drama, no "wait your turn" energy β every thread can pull up whenever. π
π AVAILABILITY π
This function is available since SDL 3.2.0.
if you're on something older than that, she simply does not exist yet and you will get absolutely nothing. not me finding out the hard way π
okay that's the whole page, you're fully caught up, go silence some audio buffers and slay π
Simple Directmedia Layer, SDL 3.4.18 β mwah, thanks for reading, ily, bye 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