How do I repeat a AVAudioPlayer?

后端 未结 3 1630
傲寒
傲寒 2020-12-29 17:27

I am just wondering how you repeat a AVAudioPlayer?

3条回答
  •  鱼传尺愫
    2020-12-29 18:26

    From the iOS docs:

    numberOfLoops

    The number of times a sound will return to the beginning, upon reaching the end, to repeat playback.

    @property NSInteger numberOfLoops Discussion A value of 0, which is the default, means to play the sound once. Set a positive integer value to specify the number of times to return to the start and play again. For example, specifying a value of 1 results in a total of two plays of the sound. Set any negative integer value to loop the sound indefinitely until you call the stop method.

    Availability Available in iOS 2.2 and later. Declared In AVAudioPlayer.h

提交回复
热议问题