decodeAudio method
Decode more audio from a MIX_AudioDecoder.
Data is decoded on demand in whatever format is requested. The format is permitted to change between calls.
This function will return the number of bytes decoded, which may be less than requested if there was an error or end-of-file. A return value of zero means the entire file was decoded, -1 means an unrecoverable error happened.
\param audiodecoder the decoder from which to retrieve more data.
\param buffer the memory buffer to store decoded audio.
\param buflen the maximum number of bytes to store to buffer.
\param spec the format that audio data will be stored to buffer.
\returns number of bytes decoded, or -1 on error; call SDL_GetError() for
more information.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL_mixer 3.0.0.
extern SDL_DECLSPEC int SDLCALL MIX_DecodeAudio(MIX_AudioDecoder *audiodecoder, void *buffer, int buflen, const SDL_AudioSpec *spec)
{@category mixer}
Implementation
int decodeAudio(
Pointer<NativeType> buffer,
int buflen,
Pointer<SdlAudioSpec> spec,
) => mixDecodeAudio(this, buffer, buflen, spec);