在iPhone应用里用到AVAudioPlayer
播放音频文件。然后从AVAudioPlayer 中获取持续时间
我获得的duration值是这样的:252.765442。
但是我想要的是这种格式: HH/MM/SS 02:52:76
如何转换?请帮忙
我写出来的代码没有用:
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:tempFilePath] error:&err];
[audioPlayer setDelegate:self];
[audioPlayer prepareToPlay];
float duration = (float)audioPlayer.duration;
NSLog(@"duration:%f",duration);