Is it possible to play only part of an mp3 file using AVAudioPlayer? If so, how?

Hi, I have locally stored mp3 files at 5:00 minutes in an application for iPhone.

I would like to know if it is possible to play only the gap from this file using AVAudioPlayer after it is ready ToPlay, say, from 0:25 to 1:34.

If possible, how can I achieve this?

I know that I can move the playing field pointer using setCurrentTime: but how can I let AVAudioPlayer know how many seconds it should play from this current time.

Any help is greatly appreciated.

+3
source share
3 answers

, .

+4

@Horatiu NSTimer, setCurrentTime:, NSTimer .

+1

Fire timer when starting file playback. When the required time is reached pauseor stop, the player

0
source

Source: https://habr.com/ru/post/1796261/


All Articles