美文网首页
AVURLAsset 获取录音文件时长

AVURLAsset 获取录音文件时长

作者: 今年27 | 来源:发表于2018-10-08 15:24 被阅读289次

AVURLAsset* audioAsset =[AVURLAsset URLAssetWithURL:[NSURL URLWithString:message.text] options:nil];
CMTime audioDuration = audioAsset.duration;
float audioDurationSeconds =CMTimeGetSeconds(audioDuration);
_audio_timeLabel.text = [NSString stringWithFormat:@"%d", (int)audioDurationSeconds];

相关文章

网友评论

      本文标题:AVURLAsset 获取录音文件时长

      本文链接:https://www.haomeiwen.com/subject/gzhjaftx.html