Add Mp3 Tags (1 Viewer)

giddyhead

Registered User.
Local time
Today, 15:34
Joined
Jul 3, 2014
Messages
88
Hello Everyone,

I have a Audio CD that was downloaded to the desktop and I wanted to know how can I use the following access code to add the MP3 Tags to all of them like Names, Genre, Titles, Album, Artist, etc based upon a table I have in access? Thanks

The following code is what I have to cycle through the folder to update the below fields from the MP3Properties table however when I run it I get a Compile error: ByRef argument type mismatch. Not sure why it will not turning over.

Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM MP3Properties")

If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
Do Until rs.EOF = True

Call SetID3Tag(Forms![UpdateMp3]![Text2], ((rs!Album)))
Call SetID3Tag(Forms![UpdateMp3]![Text2], ((rs!Title)))
Call SetID3Tag(Forms![UpdateMp3]![Text2], ((rs!Genre)))
rs.MoveNext
Loop
Else
MsgBox "There are no records in the recordset."
End If

rs.Close
Set rs = Nothing

'Dim TblCnt As Long
'TblCnt = DCount("*", "MP3Properties")

'Call GetID3Tag(Forms![UpdateMp3]![Text2], 237)
'Call SetID3Tag(Forms![UpdateMp3]![Text2], 237)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:34
Joined
Feb 19, 2013
Messages
16,607
I presume the error is on the first call to to your setid3function - byref implies it is the call - either you are passing a value which cannot be updated or perhaps the wrong datatype. Not possible to say without knowing the code to that function
 

giddyhead

Registered User.
Local time
Today, 15:34
Joined
Jul 3, 2014
Messages
88
That is correct on the first call. I have attached a copy of the bas file of that function.
 

Attachments

  • mdl__ID3.zip
    983 bytes · Views: 209

giddyhead

Registered User.
Local time
Today, 15:34
Joined
Jul 3, 2014
Messages
88
Yes that is correct same code. I tried to use rs!Album and I have also tried Call GetID3Tag(Forms![UpdateMp3]![Text2], 237) and still get the error for Album Artist.
Is using Album or Genre or the corresponding number (237, etc) is that the ID3Tag Type?
In addition when I also use Call SetID3TagDirect("C:\Users\mrdrj\Desktop\Brimstone\2. My God Reigns.mp3", "Brimstone", "My God Reigns", "The Holy Spirit", "", "1998", "Religious") I get a Run-time error 13. Type mismatch.
The table that I have contains the Track#, Title, Genre, Album, Album Artist & Contributing Artist and I want to put the Tags from the table into the Mp3 songs. What am I missing?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:34
Joined
Feb 19, 2013
Messages
16,607
go back and check your parameters - they are not all text
 

giddyhead

Registered User.
Local time
Today, 15:34
Joined
Jul 3, 2014
Messages
88
I went and made the updates in italics and what is bold is the only changes made when it is ran.
Call SetID3TagDirect("C:\Users\mrdrj\Desktop\Brimstone\2. My God Reigns.mp3", Brimstone, "My God Reigns", "The Holy Spirit", "", 1998, Gospel)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:34
Joined
Feb 19, 2013
Messages
16,607
I presume you are still getting the same error? if so looks like you changed the wrong parameter
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:34
Joined
May 7, 2009
Messages
19,237
the tag you are adding is id3v1 (version 1).
upon testing your code, I noticed that you need to change
- 127 to - 128, this is the starting point of the id33v1 structure.

on your code add the structure first to your mp3 file (do this only once):

call NewID3("C:\Users\mrdrj\Desktop\Brimstone\2. My God Reigns.mp3")

then add the other info:

Call SetID3TagDirect("C:\Users\mrdrj\Desktop\Brimstone\2. My God Reigns.mp3", Brimstone, "My God Reigns", "The Holy Spirit", "", "1998", 38)

note: genre:38 (genre is Byte meaning 0-255, see https://en.wikipedia.org/wiki/List_of_ID3v1_Genres)
 

giddyhead

Registered User.
Local time
Today, 15:34
Joined
Jul 3, 2014
Messages
88
I am trying to make the changes but its not falling into place so I decided to attached the example that I am working on and also screen shots of the error along with the tracks that I am trying to update. Thanks Update Tracks.PNG List of Tracks.PNG
Update Tracks.PNG
List of Tracks.PNG
 

Attachments

  • Modify.accdb
    1 MB · Views: 223

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:34
Joined
May 7, 2009
Messages
19,237
I made some modification on the Class.
for demo use my Split form.
add new mp3. ("get file", button)
edit the info on the bottom window.

on New record fetch same file name.
you will see that the info is saved to the .mp3 file.
 

Attachments

  • Modify.zip
    128.4 KB · Views: 227

giddyhead

Registered User.
Local time
Today, 15:34
Joined
Jul 3, 2014
Messages
88
Thanks for taken a look at it. When I enter the information in the bottom window for some reason only the year populates. What steps am I missing so that it can turn over to update all the songs accordingly. Picture of form.PNG Picture of Songs.PNG
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:34
Joined
May 7, 2009
Messages
19,237
these are the equivalent fields in your table

1589305037742.png
 

giddyhead

Registered User.
Local time
Today, 15:34
Joined
Jul 3, 2014
Messages
88
I have tried once more and unfortunately only the sections of comments and year updates.
 

isladogs

MVP / VIP
Local time
Today, 20:34
Joined
Jan 14, 2017
Messages
18,217
Suggest you have another look at my Extended File Properties app. It works!
 

Users who are viewing this thread

Top Bottom