sdlGetCurrentAudioDriver function

String? sdlGetCurrentAudioDriver()

Get the name of the current audio driver.

The names of drivers are all simple, low-ASCII identifiers, like "alsa", "coreaudio" or "wasapi". These never have Unicode characters, and are not meant to be proper names.

\returns the name of the current audio driver or NULL if no driver has been initialized.

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

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentAudioDriver(void)

Implementation

String? sdlGetCurrentAudioDriver() {
  final sdlGetCurrentAudioDriverLookupFunction = libSdl3.lookupFunction<
      Pointer<Utf8> Function(),
      Pointer<Utf8> Function()>('SDL_GetCurrentAudioDriver');
  final result = sdlGetCurrentAudioDriverLookupFunction();
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}