0

我正在尝试使用这些代码行获取 mp3 文件的艺术作品。

    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];

如果我正在使用:

NSLog (@"image %@, image");

或者

NSLog (@"image %@, [image description]");

有NULL。

如何使用 kAudioFilePropertyAlbumArtwork 获取 mp3 文件的图稿?

4

1 回答 1

0

你想要的功能是AudioFileGetProperty,不是AudioFileGetGlobalInfo

于 2013-02-27T19:56:42.303 回答