mixHasChunkDecoder function
Check if a chunk decoder is available by name.
This result can change between builds AND runs of the program, if external libraries that add functionality become available. You must successfully call Mix_OpenAudio() before calling this function, as decoders are activated at device open time.
Decoder names are arbitrary but also obvious, so you have to know what you're looking for ahead of time, but usually it's the file extension in capital letters (some example names are "AIFF", "VOC", "WAV").
\param name the decoder name to query. \returns true if a decoder by that name is available, false otherwise.
\since This function is available since SDL_mixer 3.0.0.
\sa Mix_GetNumChunkDecoders \sa Mix_GetChunkDecoder
extern SDL_DECLSPEC bool SDLCALL Mix_HasChunkDecoder(const char *name)
Implementation
bool mixHasChunkDecoder(String? name) {
final mixHasChunkDecoderLookupFunction = libSdl3Mixer.lookupFunction<
Uint8 Function(Pointer<Utf8> name),
int Function(Pointer<Utf8> name)>('Mix_HasChunkDecoder');
final namePointer = name != null ? name.toNativeUtf8() : nullptr;
final result = mixHasChunkDecoderLookupFunction(namePointer) == 1;
calloc.free(namePointer);
return result;
}