TagLib is a library for reading and editing the meta-data of several popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC, Speex, WavPack, TrueAudio, WAV, AIFF, MP4 and ASF files.
- The Objective C Wrapper is based on eni9889 TagLib-Objc's implementation.
- TagLib version 1.11.1 from GitHub is compiled...
To run the example project, clone the repo, and run pod install
from the Example directory first.
Swift Example:
let audio = TLAudio(fileAtPath: audioFilePath.path)!
audio.title = "exampleTitle"
audio.artist = "exampleArtist"
audio.album = "exampleAlbum"
audio.comment = "exampleComment"
audio.genre = "exampleGenre"
audio.year = 2001
audio.track = 1
audio.updateTag("ALBUMARTIST", stringValue: "exampleAlbumArtist")
audio.updateTag("DISCNUMBER", stringValue: "1")
audio.updateTag("TOTALDISCS", stringValue: "2")
audio.updateTag("TOTALTRACKS", stringValue: "15")
audio.frontCoverPicture = imageData
audio.artistPicture = imageData
audio.save()
audio.audioProperties.forEach { print("audio.audioProperties key -> \($0) value -> \($1)") }
audio.allTags.forEach { print("audio.allTags key -> \($0) value -> \($1)") }
Currently only a Flac and MPEG/MP3 wrapper are included...
TagLibIOS is available through CocoaPods. In order to compile this correctly one has to add use_frameworks!
to the Podfile!
To install it, simply add the following lines to your Podfile:
use_frameworks!
target 'MyApp' do
pod 'TagLibIOS'
end
2019-12-31
- Bug fix - fixed the handling of Unicode characters in the updateTag() function
2019-10-30
- Expanded tag support to provide read and write access to all tags in the audio file. See this for details -> TagLib PropertyMap Keys.
- Exposed the audioProperties for the audio file
- Added support for AIFF files
2022-03-21
- Added support for MP3 ID3 POPM tags via TagLib PopularimeterFrame's. See this for details -> TagLib PopularimeterFrame.
- Exposed the TLMP3 class to use when specifically dealing with MP3 files, as new rating functions are not part of the TLAudio interface
TagLib is distributed under the GNU Lesser General Public License (LGPL) and Mozilla Public License (MPL). Essentially that means that it may be used in proprietary applications, but if changes are made to TagLib they must be contributed back to the project. Please review the licenses if you are considering using TagLib in your project.