美文网首页
计算音频长度

计算音频长度

作者: 码农淏 | 来源:发表于2016-12-03 15:20 被阅读30次
// 耗时操作, 在主线程

AVURLAsset *avUrl = [AVURLAsset assetWithURL:[NSURL URLWithString:bodiesModel.url]];

CMTime time = [avUrl duration];

int seconds = ceil(time.value/time.timescale);

在工程中连接CoreMedia和AVFoundation框架

相关文章

网友评论

      本文标题:计算音频长度

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