我正在尝试使用AVMutableMetadataItem修改iTunes库中某些歌曲的信息,但是对此不走运。我仍在学习如何做,但找不到任何文档。
static func writeID3(_ audioFiles: URL)
{
let audio = AVPlayerItem(url: audioFiles)
let meta = audio.asset.metadata(forFormat: .iTunesMetadata)
for eachMeta in meta
{
let av = AVMutableMetadataItem()
av.keySpace = AVMetadataKeySpace.iTunes
av.key = AVMetadataKey.iTunesMetadataKeyAlbumArtist as NSString
av.value = "Various Artists" as NSString
}
}