SDL_HINT_AUDIO_FREQUENCY(3)

πŸ’– SDL_HINT_AUDIO_FREQUENCY πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, and today's main character is SDL_HINT_AUDIO_FREQUENCY 🌸


✨ NAME ✨

SDL_HINT_AUDIO_FREQUENCY β€” a variable controlling the default audio frequency. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_hints.h>

#define SDL_HINT_AUDIO_FREQUENCY "SDL_AUDIO_FREQUENCY"

so you literally just include the header and the macro is right there, no cap πŸ’…


🌈 DESCRIPTION 🌈

so here's the tea, bestie: if your application doesn't specify the audio frequency when it opens the device, this hint steps in and specifies a default frequency that will be used instead. she's the backup plan. the understudy. the friend who holds your bag 🫢

and the default default? it's "44100" ✨ iconic number, no notes.

⚠️ lowkey important: this hint should be set before an audio device is opened. set it after and she simply will not hear you, fr fr 😭

πŸ‘‘ AVAILABILITY πŸ‘‘

this hint is available since SDL 3.2.0. so if you're on something older... not me finding out the hard way πŸ’€


Simple Directmedia Layer 🌸 SDL 3.4.18 🌸 SDL_HINT_AUDIO_FREQUENCY(3)

k that's the whole page bestie, go set your hint before you open that device and slay πŸ’–βœ¨πŸ¦‹πŸŽ€πŸ’…

πŸ“¦ where this page comes from