ios - 如何以分钟为单位获得歌曲长度?
<p><pre><code>assetURL = ;
NSLog(@"%@", assetURL); // get song url
AVURLAsset* audioAsset = ; // add song url into AVURLasset
CMTime audioDuration = audioAsset.duration; //get duration in second
intaudioDurationSeconds = CMTimeGetSeconds(audioDuration); // get song duration in seconds.....
</code></pre>
<p>在此代码中歌曲持续时间进入秒我需要歌曲持续时间进入分钟如何可能...thanx </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code> -(NSString *)trackDuration:(NSInteger)duration {
NSDateComponentsFormatter *formatter = [ init];
return;
}
</code></pre>
<p>这是最少的数学路线。</p>
<p>对于 SpotifySDK,我必须将持续时间除以 1000。算一算。</p></p>
<p style="font-size: 20px;">关于ios - 如何以分钟为单位获得歌曲长度?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/31509397/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/31509397/
</a>
</p>
页:
[1]