I'm trying to get artwork of the mp3 file using these lines of code.
CFDataRef AlbumPic= nil;
UInt32 picDataSize = sizeof(picDataSize);
err =AudioFileGetGlobalInfo(kAudioFilePropertyAlbumArtwork, 0, NULL, &picDataSize, &AlbumPic);
if( err != noErr ) {
NSLog( @"error" );
}
NSData* imagedata= (__bridge NSData*)AlbumPic;
UIImage* image=[[UIImage alloc]initWithData:imagedata];
If I'm using:
NSLog (@"image %@, image");
or
NSLog (@"image %@, [image description]");
there is NULL.
How can I get artwork of mp3 file using kAudioFilePropertyAlbumArtwork?