0

Well I get this error (The ID3v2TagVersions value of '4' (4) is not valid for this operation.) with UltraID3Lib on Visual Basic 2013. I want to use this library (dll) so i can edit my mp3 tags in a mp3 file. Although I achived changing the tags , when i use the Clear() sub and then retry to change the tags i get this error. Can anyone help me ?

My Code

    Private Sub btnExecute_Click(sender As Object, e As EventArgs) Handles btnExecute.Click
        Dim Artist As String = ""
        Dim Title As String = ""
        Dim MP3TagEditor As New UltraID3
        For Each Path In MP3List
            MP3TagEditor.Read(Path)
            Title = "Somthing"
            Artist = "Somthing"
            MP3TagEditor.ID3v2Tag.Title = Title
            MP3TagEditor.ID3v2Tag.Artist = Artist
            MP3TagEditor.Clear()
            MP3TagEditor.Write()
        Next
        MsgBox("Tags Added", MsgBoxStyle.Information, "Success")
End Sub

Thanks

sheach
  • 65
  • 11

2 Answers2

0

Try this

Dim sTitle As String = "No Name"
Dim sSinger As String = ""
Dim sAlbum As String = ""
Dim sYear As String = ""
Dim sComm As String = ""
Dim MP3Tag As New UltraID3
                MP3Tag.Read(YOUR_PATH)

                Try
                    Dim pics = MP3Tag.ID3v2Tag.Frames.GetFrames(CommonMultipleInstanceID3v2FrameTypes.Picture)
                    AlbumPic.Image = CType(pics(0), ID3v2PictureFrame).Picture
                Catch ex As Exception
                    AlbumPic.Image = My.Resources.FlatCD
                End Try
                Try
                    sTitle = MP3Tag.Title
                    sSinger = MP3Tag.Artist
                    sAlbum = MP3Tag.Album
                Catch ex As Exception

                End Try
  • Well , the thing is that, I Dont want to read the Tags from the file , I need to add tags to it. Example:"I dont want to do the **sTitle = MP3Tag.Title** I need to do the **MP3Tag.Title = sTitle** and then **MP3Tag.Write()** . But When i Do the **MP3Tag.Clear()** I will get an error trying to manipulate the tags – sheach Aug 31 '15 at 10:58
  • Try without Clear() function. –  Sep 02 '15 at 19:21
  • Well I need that Class , thats why Im using it . I now use a secondary class that I created just to clear the Tags but i dont think it is realy doing what i want it to do. So thats why I need to solve this problem – sheach Sep 10 '15 at 20:40
0

You cannot read ID3v2.4 tags from an MP3 file with UltraID3Lib. It doesn't support it yet. (As of 31/12/2015).

But there is an alternative, which, in my humble opinion is even better, stable and efficacious:

It supports many other tag types as well apart from ID3, i.e, MP3 Files. A quick example to get you on the way:

Dim f As TagLib.File = TagLib.File.Create("someFile.mp3")
Dim artist As String = f.Tag.JoinedPerformers
Dim title As String = f.Tag.Title

More resources for TagLib-Sharp:

Community
  • 1
  • 1
Fᴀʀʜᴀɴ Aɴᴀᴍ
  • 6,131
  • 5
  • 31
  • 52