【发布时间】:2012-03-01 22:41:07
【问题描述】:
这是检查AVAudioPlayer's当前播放时间的正确方法吗?
[audioPlayer play];
float seconds = audioPlayer.currentTime;
float seconds = CMTimeGetSeconds(duration);
之后我如何编码
[audioPlayer play];
当 currentTime 等于 11 秒时
[self performSelector:@selector(firstview) withObject:nil];
当 currentTime 等于 23 秒时在 firstview 之后
[self performSelector:@selector(secondview) withObject:nil];
【问题讨论】:
-
安排一个检查时间的并行计时器。
currentTime返回一个 NSTimeInterval 变量,所以double seconds = audioPlayer.currentTime;是正确的。
标签: ios avaudioplayer