AVAudioPlayer fade volume out

前端 未结 13 2076
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 12:07

I have an AVAudioPlayer playing some audio (duh!)

The audio is initiated when the user presses a button. When they release it I want the audio to fade out.

I

13条回答
  •  鱼传尺愫
    2020-12-12 12:28

    A very good solution to this problem is available from Nick Lockwood at objc.io. It leverages Core Animation to time volume changes which can come in handy if one needs to synchronise UI animations with audio volume changes, including interactive animations.

提交回复
热议问题