ios - How to get the size of a song in ipod library? -
i have been working on media player app.i able media items using media query,group them based on different groupings , add various filters narrow down search.
now requirement find out size of particular song in ipod library.i tried google did not direction proceed.is possible song size or not supported apis. btw using xamarin developing app.
thanks in advance help.
you can use below code size of song.
nsurl *urlasset = [anitem valueforproperty: mpmediaitempropertyasseturl]; avurlasset *songasset = [avurlasset urlassetwithurl:urlasset options:nil]; avassetexportsession *exportsession = [[avassetexportsession alloc] initwithasset: songasset presetname: avassetexportpresetapplem4a]; cmtime half = cmtimemultiplybyfloat64(exportsession.asset.duration, 1); exportsession.timerange = cmtimerangemake(kcmtimezero, half); long long size = exportsession.estimatedoutputfilelength; nslog(@"size=%lld",size);
Comments
Post a Comment