Hook a processor function into a channel for post processing effects. You may just be reading the data and displaying it, or you may be altering the stream to add an echo. Most processors also have state data that they allocate as they are in use, this would be stored in the $arg data space. When a processor is finished being used, any function passed into $done_callback will be called.

The effects are put into a linked list, and always appended to the end, meaning they always work on previously registered effects output.

Returns: Zero on errors, such as a nonexisting channel.

Note: Passing MIX_CHANNEL_POST will register the $effect_callback as an postmix effect.

Remove the registered effect function from the effect list for channel. If the channel is active the registered effect will have its $done_callback function called, if it was specified in SDL::Mixer::Effects::register.

Returns: Zero on errors, such as invalid channel, or effect function not registered on channel.

This removes all effects registered to $channel. If the channel is active all the registered effects will have their $done_callback functions called, if they were specified in SDL::Mixer::Effects::register.

Hook a processor function to the postmix stream for post processing effects. You may just be reading the data and displaying it, or you may be altering the stream to add an echo. This processor is never really finished, until you call it without arguments. There can only be one postmix function used at a time through this method. Use SDL::Mixer::Effects::register with MIX_CHANNEL_POST to use multiple postmix processors. This postmix processor is run AFTER all the registered postmixers set up by SDL::Mixer::Effects::register.

This effect emulates a simple 3D audio effect. It's not all that realistic, but it can help improve some level of realism. By giving it the angle and distance from the camera's point of view, the effect pans and attenuates volumes.

$angle is the direction in relation to forward from 0 to 360 degrees. Larger angles will be reduced to this range using angles % 360.

0 = directly in front.

90 = directly to the right.

180 = directly behind.

270 = directly to the left.

So you can see it goes clockwise starting at directly in front.

$distance is 0(close/loud) to 255(far/quiet).

Note: Using angle and distance of 0, will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use SDL::Mixer::Effects::unregister_all on the channel.