SDL_HINT_ANDROID_AAUDIO_INPUT_PRESET(3)

πŸ“¦
version 3.4.18 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– SDL_HINT_ANDROID_AAUDIO_INPUT_PRESET πŸ’–

okay bestie, welcome to the SDL_HINT_ANDROID_AAUDIO_INPUT_PRESET page β€” it's a lil' corner of the SDL3 docs, and honestly? it's giving "niche but iconic". πŸŽ€


✨ NAME ✨

SDL_HINT_ANDROID_AAUDIO_INPUT_PRESET β€” a variable that controls Android's AAudio input preset. literally just a hint, but it can be the whole main character when your mic is acting up. 🎀


✨ SYNOPSIS ✨

#include <SDL3/SDL_hints.h>

#define SDL_HINT_ANDROID_AAUDIO_INPUT_PRESET "SDL_ANDROID_AAUDIO_INPUT_PRESET"

that's it, that's the whole vibe. πŸ¦‹


✨ DESCRIPTION ✨

so first things first β€” this hint only applies to SDL's "aaudio" backend on Android 9+ devices. no Android 9? no aaudio? then this whole page is not your moment, sorry babe. πŸ™ˆ

here's the tea: some devices just choose the wrong microphone by default. and when we say "wrong", we mean between:

  • the mic that's meant to be spoken into when you're holding the phone to your ear for a phone call πŸ“ž
  • an external microphone that's meant for recording video πŸŽ₯

and sometimes devices also have DSP effects applied to the recorded audio 😭, which is a whole situation. changing the input preset can help control all of this. slay.

this can be any number that maps to an AAUDIO_INPUT_PRESET_* enum from the Android NDK headers. the most reasonable choices are:

  • 5 β€” "camcorder", for external microphones πŸŽ₯
  • 7 β€” "voice communication", for speaking directly into the device like a mobile phone πŸ“±
  • 6 β€” "voice recognition", which might also be a useful choice πŸ‘‘

if it's unset (that's the default, bestie), SDL will not specify an input preset at all, which lets the system choose. and honestly? that's usually the correct thing to do unless your app is having problems. don't fix what isn't broken, periodt. πŸ’…

⚠️ okay important: this hint should be set before a recording audio device is opened. set it late and it's just not gonna hit the same. πŸ’€

✨ AVAILABILITY ✨

this hint has been available since SDL 3.4.16. she's new-ish, she's fresh, she's ready. ✨🌈


and that's a wrap on the SDL_HINT_ANDROID_AAUDIO_INPUT_PRESET page, bestie!! go forth and pick the right mic πŸ«ΆπŸ’œ

mwah πŸ’‹ β€” this page came from Simple Directmedia Layer, docs for SDL 3.4.18, in the SDL3 FUNCTIONS manual. ty for reading, ily, bye!! πŸŽ€βœ¨

πŸ“¦ where this page comes from