我正在使用流音频文件第一次,我的音频文件是流媒体和seekTOTime也工作,即从新选择的滑块位置流音频,但之后我的滑块被轻弹,我得到错误的当前时间或播放时间。
- (IBAction)currentTimeSliderValueChanged:(id)sender
{
[streamer seekToTime:self.currentTimeSlider.value * duration];
}
我正在更新我的滑块值
if (streamer.bitRate != 0.0)
{
double duration = streamer.duration;
double progress = streamer.progress;
int minProgress = (int)progress/60%60;
int secProgress = (int)progress%60;
double totalSec = CMTimeGetSeconds(asset.duration);
int minDur = (int)totalSec/60%60;
int secDur = (int)totalSec%60;
if(duration > 0)
{
[self.elapsedTimeLabel setText:
[NSString stringWithFormat:@"%d:%d",
minProgress,secProgress]];
[self.remainingTimeLabel setText:[NSString stringWithFormat:@"%d:%d",minDur,secDur]];
[self.currentTimeSlider setEnabled:YES];
[self.currentTimeSlider setValue: progress/duration];
}
}
但是我在seekToTime之后得到了错误的elapsedTimeLabel值,当流式传输结束时我得到了错误 “AudioQueue以意想不到的方式改变了状态。” “音频队列获取当前时间失败。错误:˛˚ä-66678”