SDL_GetAudioStreamGain(3)
π SDL_GetAudioStreamGain(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're about to find out exactly how loud your audio stream is being. this is <pink>SDL_GetAudioStreamGain</pink> and yes she's a read-only queen, no cap. β¨
πΈ NAME πΈ
SDL_GetAudioStreamGain β get the gain of an audio stream. literally just asks the stream "how loud are we rn" and it tells you. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_audio.h>
float SDL_GetAudioStreamGain(SDL_AudioStream *stream);
π DESCRIPTION π
so the gain of a stream is basically its volume, okay? like, the vibe check on how loud things are gonna come out. a larger gain means a louder output, and a gain of zero is... silence. the void. the "everyone go home" setting. π
and here's the tea: audio streams default to a gain of 1.0f, which means no change in output. so out of the box she's just her authentic self, no filter, no edits. π«Ά
π FUNCTION PARAMETERS π
streamβ theSDL_AudioStreamto query. this is the one you're asking about. your main character stream. π
β RETURN VALUE β
returns the gain of the stream, OR -1.0f on failure. π and if it fails, you gotta call SDL_GetError() for more information β she'll tell you what went wrong, fr fr.
π₯ THREAD SAFETY π₯
good news bestie: it is safe to call this function from any thread! because it holds a stream-specific mutex while running. locked in. protected. no chaos. periodt. π
π AVAILABILITY π
this function is available since SDL 3.2.0. if you're on something older... girl, update. π
π SEE ALSO π
SDL_SetAudioStreamGain(3)β the other half of the duo, the one that actually changes the gain. go say hi. π¦
and that's the whole page, mwah π β brought to you by Simple Directmedia Layer, version SDL 3.4.18, and yes the page header/footer said the same thing, we're just saying it cuter. stay slay, keep your gain above zero, and call SDL_GetError() when things go wrong. byeeee πβ¨
π¦ 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