« MBS Xojo Plugins, ver… | Home | Four ways to save pic… »

TagLib to write ID3v2 Tags in Xojo

As you may know, we use TagLib, an open source library to read metadata from audio files, e.g. ID3 tags.

With our TagLibFileRefMBS class you can read properties of an audio file including all the common values like artist, title, album or comment. We now got a setProperties method to update the properties and add/change/delete a few. Just pass in the dictionary with changes. Keys with nil values remove an entry and otherwise add or replace it:

Dim file As FolderItem = SpecialFolder.Desktop.Child("test.mp3") Dim tag As New TagLibFileRefMBS(file) Dim dic As Dictionary = tag.Properties Break // inspect dictionary dic.Value("ARTIST") = "John Doe" dic.Value("ALBUM") = Nil // clear this one tag.SetProperties(dic) If tag.Save Then MsgBox "OK" Else MsgBox "Failed to save" End If
Currently TagLib 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 biggest plugin in space...
12 09 19 - 17:04

Start Chat