'How do you play a sound/buffer in reverse with AudioKit / AudioPlayer?

I would like to playback buffered audio samples with variable speed, forward or reverse. I'm aware of the isReversed attribute of AudioPlayer but am not succeeding in playing sounds in reverse.

Can anyone point me to an example or a hint?



Solution 1:[1]

This can be achieved via the reverse method of a buffer:

myBufferReversed = myBuffer.reverse()

Then, a player instance can be set to use myBufferReversed instead.

I believe but have not confirmed that this can also be achieved by setting the isReversed attribute to true as described on this wiki page: https://github.com/AudioKit/AudioKit/wiki/AudioPlayer

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ali Momeni