【发布时间】:2015-10-09 03:45:33
【问题描述】:
assetURL = [item valueForProperty: MPMediaItemPropertyAssetURL];
NSLog(@"%@", assetURL); // get song url
AVURLAsset* audioAsset = [AVURLAsset URLAssetWithURL:assetURL options:nil]; // add song url into AVURLasset
CMTime audioDuration = audioAsset.duration; //get duration in second
int audioDurationSeconds = CMTimeGetSeconds(audioDuration); // get song duration in seconds.....
在此代码中歌曲持续时间进入第二个我需要歌曲持续时间进入分钟如何可能...thanx
【问题讨论】:
-
不工作 .. 不要将 cm 时间转换为 int 和 float
标签: ios objective-c audio duration minute