SDL_HINT_AUDIO_CATEGORY(3)
π SDL_HINT_AUDIO_CATEGORY π
okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_HINT_AUDIO_CATEGORY β literally just a variable that controls the audio category on iOS and macOS. that's it. that's the whole vibe. π
β¨ NAME β¨
SDL_HINT_AUDIO_CATEGORY β a variable controlling the audio category on iOS and macOS.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_hints.h>
#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY"
like, that's the whole thing. one include, one define. slay. π
π¦ DESCRIPTION π¦
so the variable can be set to the following values, and this is the part where you actually have to pay attention:
"ambient"β use theAVAudioSessionCategoryAmbientaudio category. heads up: this one will be muted by the phone mute switch. also, it's the default. so if you don't set anything, this is what you get. π"playback"β use theAVAudioSessionCategoryPlaybackcategory. no mute switch shenanigans here, it's giving main character energy. π₯
if you want more info (and honestly, Apple's docs are right there), see Apple's documentation: https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
β οΈ and this is the important one, bestie: this hint should be set before an audio device is opened. not after. before. set it late and the universe simply will not cooperate, no cap. π
π AVAILABILITY π
this hint is available since SDL 3.2.0. so if you're on something older... yeah, you're not getting this one. π
and that's the page!! you understood all of it, i'm so proud, fr fr. π«Άβ¨
sending you love from the Simple Directmedia Layer girlies β this is SDL 3.4.18, and yeah the manual page header said SDL_HINT_AUDIO_CATEGORY(3) on it too, iconic. bye bestie, go set your audio category BEFORE you open the device!! πππ¦
π¦ 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