문제

I am playing an audio clip using AvAudipPlayer, I want to know if there is a way to get progress on how much time is left or played ? I want to animate the slider control while the audio is being played in a view is this possible ?

도움이 되었습니까?

해결책

You should read AVAudioPlayer's documentation. You'll find that the player has two properties that pertain to this, currentTime and duration

audioPlayer.currentTime

audioPlayer.duration

Then, assuming that you're leaving your sliders min and max values at their default settings (0 - 1), you can determine progress by simply dividing currentTime by duration.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top