sdlGetAudioFormatName function
Get the human readable name of an audio format.
\param format the audio format to query. \returns the human readable name of the specified audio format or "SDL_AUDIO_UNKNOWN" if the format isn't recognized.
\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_GetAudioFormatName(SDL_AudioFormat format)
Implementation
String? sdlGetAudioFormatName(int format) {
final sdlGetAudioFormatNameLookupFunction = libSdl3.lookupFunction<
Pointer<Utf8> Function(Int32 format),
Pointer<Utf8> Function(int format)>('SDL_GetAudioFormatName');
final result = sdlGetAudioFormatNameLookupFunction(format);
if (result == nullptr) {
return null;
}
return result.toDartString();
}