SDL_HINT_AUDIO_DUMMY_TIMESCALE(3)

πŸ’– SDL_HINT_AUDIO_DUMMY_TIMESCALE πŸ’–

okay bestie, so this is a page from the SDL3 FUNCTIONS manual set, and we're about to talk about the one hint that controls the audio rate when you're running the dummy audio driver. yes, the fake one. the vibes-only one. let's get into it πŸŽ€


✨ NAME ✨

SDL_HINT_AUDIO_DUMMY_TIMESCALE β€” a variable controlling the audio rate when using the dummy audio driver.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_AUDIO_DUMMY_TIMESCALE "SDL_AUDIO_DUMMY_TIMESCALE"

like, that's the whole thing. include the header, use the macro, the macro is literally just the string. iconic. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: the dummy audio driver normally simulates real-time for the audio rate that was specified. it's out here doing its little cosplay of a real audio device, keeping pace like a good little driver. 🫢

but β€” and this is the fun part β€” you can use this variable to adjust that rate higher or lower, all the way down to 0. yes, zero. the full range, no cap.

the default value is "1.0". that's the "just do it normally, thanks" setting.

⚠️ real talk though: this hint should be set before an audio device is opened. if you roll up late and try to set it after the device is already open, that's on you. timing is everything, fr fr. πŸ’€

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. so if you're on anything older... yeah, no. it's giving "not yet". πŸ™ˆ


Simple Directmedia Layer Β· SDL 3.4.18

and that's the whole page, babe πŸŽ€ go forth, open your audio device after setting your timescale, and slay. mwah πŸ’–βœ¨

πŸ“¦ where this page comes from