0

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?

Jasonw
  • 5,054
  • 7
  • 43
  • 48
andrey
  • 671
  • 1
  • 9
  • 20

1 Answers1

0

The function you want is AudioFileGetProperty, not AudioFileGetGlobalInfo

iluvcapra
  • 9,436
  • 2
  • 30
  • 32