sdlGetNumAudioDrivers function

int sdlGetNumAudioDrivers()

Use this function to get the number of built-in audio drivers.

This function returns a hardcoded number. This never returns a negative value; if there are no drivers compiled into this build of SDL, this function returns zero. The presence of a driver in this list does not mean it will function, it just means SDL is capable of interacting with that interface. For example, a build of SDL might have esound support, but if there's no esound server available, SDL's esound driver would fail if used.

By default, SDL tries all drivers, in its preferred order, until one is found to be usable.

\returns the number of built-in audio drivers.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_GetAudioDriver

extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void)

Implementation

int sdlGetNumAudioDrivers() {
  final sdlGetNumAudioDriversLookupFunction =
      libSdl3.lookupFunction<Int32 Function(), int Function()>(
          'SDL_GetNumAudioDrivers');
  return sdlGetNumAudioDriversLookupFunction();
}