I want to get the ISRC code for Local itunes songs. I can get the metaData by the following codes:
MPMusicPlayerController *mp= mp = [MPMusicPlayerController applicationMusicPlayer];
NSURL *assetURL = [mp.nowPlayingItem valueForProperty:MPMediaItemPropertyAssetURL];
AVAsset *asset = [AVAsset assetWithURL:assetURL];
NSArray *metadata = [asset commonMetadata];
for ( AVMetadataItem* item in metadata ) {
NSString *key = [item commonKey];
NSString *value = [item stringValue];
NSLog(@"extra iptions %@",[item extraAttributes]);
NSLog(@"key = %@, value = %@", key, value);
NSLog(@"keyspace and Local %@ %@",[item keySpace],[item key]);
}
But I am really wondering about how to get ISRC(International Standard Record Coding).
Try this (warning: typed into browser)
EDIT: I should mention, the reason your original code didn't print the value of the ISRC is because the ISRC is not part of the common metadata space, and won't be included in the array returned by
[asset commonMetadata]
. The ISRC key is specific to ID3 metadata, so if your asset does not have ID3 metadata associated with it, you will be unable to retrieve that information.