使用AVAsset获取音频文件ID3信息

来源:互联网 发布:宁波丰年渔具店淘宝店 编辑:程序博客网 时间:2024/06/17 12:18

    AVAsset *mp3Asset = [AVAsset assetWithURL:audioUrl];    for (NSString *format in [mp3Asset availableMetadataFormats])    {        for (AVMetadataItem *metadataItem in [mp3Asset metadataForFormat:format])        {        NSLog(@"key=%@,commonKey=%@",metadataItem.key,metadataItem.commonKey);        }}



key=TPE1,commonKey=artist

key=TALB,commonKey=albumName

key=TYER,commonKey=(null)//上市年份

key=USLT,commonKey=(null)//歌词

key=APIC,commonKey=artwork

key=TIT2,commonKey=title

0 0