Fast Rewind & Fast Forward in AVAudioPlayer

2 Solutions Collect From Internet About “Fast Rewind & Fast Forward in AVAudioPlayer”

One possible solution is to implement the repeating action by an NSTimer. Have a look at UIButton Touch and Hold.

You can use an AVPlayer instead and change the rate property on touch down.
Change it to -2 for rewind and 2 for fast-forward.
And remember to change the rate back to 1 on touch up inside/outside.

EDIT AVPlayer‘s rate property supports values outside the 0.01.0 range IF

the associated player item returns YES for the AVPlayerItem properties canPlaySlowForward or canPlayFastForward

https://developer.apple.com/documentation/avfoundation/avplayer/1388846-rate