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.....
在此代码的歌曲时长进入第二,我需要的歌曲时长以分钟计算它是如何可能
...感谢名单如何在几分钟内获得歌曲长度?
将秒转换为分钟! http://stackoverflow.com/questions/15122883/ios-format-string-into-minutes-and-seconds –
不工作..不把cm时间转换为int和浮点数 –