mixSetReverseStereo function

int mixSetReverseStereo(
  1. int channel,
  2. int flip
)

Cause a channel to reverse its stereo.

This is handy if the user has his speakers hooked up backwards, or you would like to have a trippy sound effect.

Calling this function with flip set to non-zero reverses the chunks's usual channels. If flip is zero, the effect is unregistered.

This uses the Mix_RegisterEffect() API internally, and thus is probably more CPU intensive than having the user just plug in his speakers correctly. Mix_SetReverseStereo() returns without registering the effect function if the audio device is not configured for stereo output.

If you specify MIX_CHANNEL_POST for channel, then this effect is used on the final mixed stream before sending it on to the audio device (a posteffect).

Note that unlike most SDL and SDL_mixer functions, this function returns zero if there's an error, not on success. We apologize for the API design inconsistency here.

\param channel The mixer channel to reverse, or MIX_CHANNEL_POST. \param flip non-zero to reverse stereo, zero to disable this effect. \returns zero if error (no such channel or Mix_RegisterEffect() fails), nonzero if reversing effect is enabled. Note that an audio device in mono mode is a no-op, but this call will return successful in that case. Error messages can be retrieved from Mix_GetError().

\since This function is available since SDL_mixer 2.0.0.

extern DECLSPEC int SDLCALL Mix_SetReverseStereo(int channel, int flip)

Implementation

int mixSetReverseStereo(int channel, int flip) {
  final mixSetReverseStereoLookupFunction = libSdl2Mixer.lookupFunction<
      Int32 Function(Int32 channel, Int32 flip),
      int Function(int channel, int flip)>('Mix_SetReverseStereo');
  return mixSetReverseStereoLookupFunction(channel, flip);
}