sdlMixAudio function

void sdlMixAudio(
  1. Pointer<Uint8> dst,
  2. Pointer<Uint8> src,
  3. int len,
  4. int volume,
)

This function is a legacy means of mixing audio.

This function is equivalent to calling...

SDL_MixAudioFormat(dst, src, format, len, volume);

...where format is the obtained format of the audio device from the legacy SDL_OpenAudio() function.

\param dst the destination for the mixed audio \param src the source audio buffer to be mixed \param len the length of the audio buffer in bytes \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME for full audio volume

\since This function is available since SDL 2.0.0.

\sa SDL_MixAudioFormat

extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume)

Implementation

void sdlMixAudio(Pointer<Uint8> dst, Pointer<Uint8> src, int len, int volume) {
  final sdlMixAudioLookupFunction = libSdl2.lookupFunction<
      Void Function(
          Pointer<Uint8> dst, Pointer<Uint8> src, Uint32 len, Int32 volume),
      void Function(Pointer<Uint8> dst, Pointer<Uint8> src, int len,
          int volume)>('SDL_MixAudio');
  return sdlMixAudioLookupFunction(dst, src, len, volume);
}