mixGetMixerFormat function mixer
Get the audio format a mixer is generating.
Generally you don't need this information, as SDL_mixer will convert data as necessary between inputs you provide and its output format, but it might be useful if trying to match your inputs to reduce conversion and resampling costs.
For mixers created with MIX_CreateMixerDevice(), this is the format of the audio device (and may change later if the device itself changes; SDL_mixer will seamlessly handle this change internally, though).
For mixers created with MIX_CreateMixer(), this is the format that MIX_Generate() will produce, as requested at create time, and does not change.
Note that internally, SDL_mixer will work in SDL_AUDIO_F32 format before outputting the format specified here, so it would be more efficient to match input data to that, not the final output format.
\param mixer the mixer to query. \param spec where to store the mixer audio format. \returns true on success or false on failure; 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 bool SDLCALL MIX_GetMixerFormat(MIX_Mixer *mixer, SDL_AudioSpec *spec)
Implementation
bool mixGetMixerFormat(Pointer<MixMixer> mixer, Pointer<SdlAudioSpec> spec) {
final mixGetMixerFormatLookupFunction = _libMixer
.lookupFunction<
Uint8 Function(Pointer<MixMixer> mixer, Pointer<SdlAudioSpec> spec),
int Function(Pointer<MixMixer> mixer, Pointer<SdlAudioSpec> spec)
>('MIX_GetMixerFormat');
return mixGetMixerFormatLookupFunction(mixer, spec) == 1;
}