mixGetAudioDecoder function mixer

String? mixGetAudioDecoder(
  1. int index
)

Report the name of a specific audio decoders.

An audio decoder is what turns specific audio file formats into usable PCM data. For example, there might be an MP3 decoder, or a WAV decoder, etc. SDL_mixer probably has several decoders built in.

The names are capital English letters and numbers, low-ASCII. They don't necessarily map to a specific file format; Some decoders, like "XMP" operate on multiple file types, and more than one decoder might handle the same file type, like "DRMP3" vs "MPG123". Note that in that last example, neither decoder is called "MP3".

The index of a specific decoder is decided during MIX_Init() and does not change until the library is deinitialized. Valid indices are between zero and the return value of MIX_GetNumAudioDecoders().

The returned pointer is const memory owned by SDL_mixer; do not free it.

\param index the index of the decoder to query. \returns a UTF-8 (really, ASCII) string of the decoder's name, or NULL if index is invalid.

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

\since This function is available since SDL_mixer 3.0.0.

\sa MIX_GetNumAudioDecoders

extern SDL_DECLSPEC const char * SDLCALL MIX_GetAudioDecoder(int index)

Implementation

String? mixGetAudioDecoder(int index) {
  final mixGetAudioDecoderLookupFunction = _libMixer
      .lookupFunction<
        Pointer<Utf8> Function(Int32 index),
        Pointer<Utf8> Function(int index)
      >('MIX_GetAudioDecoder');
  final result = mixGetAudioDecoderLookupFunction(index);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}