ID3 tags : a New LC Lib ?

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Eric_Taquet
Posts: 23
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

ID3 tags : a New LC Lib ?

Post by Eric_Taquet » Sat Nov 02, 2019 12:49 pm

Hi all !

I'm looking for someone who could make me a library / external to manage ID3 tags, or tell me where I can find something equivalent.

I looked at id3lib v1.0.0, but it is old, not compatible with id3v2.4, and too complex to use. I am looking for something very simple, with only 3 functions: read, write, and what.

I detail below the specifications for this development.

I do not have enough time, and not enough skill to do that.

I run a French non-profit association, which works in the field of visual disability. I can use a little money to pay an annual license, for example, if it is not too expensive ;-)

With LC 9.5 Indy, I'm developing two independent applications:
- one to produce commercial sound libraries that must be tagged with ID3;
- the other to manage two big mp3 album collections (a music album collection, and one of audiobooks) that need to be better organized and easily manageable.

Thank you for your help!
Éric

===============
WRITE FUNCTION :

get ID3write (tArray, mp3FilePath)

-- tArray is like (no limit for number of keys=frameCodes, no order) :
key value
"TALB" "My new sound project"
"TDRC" "2019"
"APIC" imageFilePath
"TXXX" "projectid", "xYz-12"
… …
-- for T text frames, the text encoding description byte must be $01 (UTF-16) because a lot of frequently used chars in various langages are not in ISO 8859-1 (encoding byte $00), like œ in french and all chars with diacritic
-- ID3write() returns empty or « error » && a list of error descriptions …

==============
READ FUNCTION :

get ID3read (tagCodes, mp3FilePath, folderPathForAPIC)

-- tagCodes can be any length comma list as : "APIC,COMM,TALB,TCOP,TDRC,TXXX,USLT"
-- ID3read() returns an array like described above
-- for the APIC key, the returned value is a line list of filenames of the image(s) saved in the specified folder
-- for the TXXX key, the result is a text string like : frameDescription tab theValue ; if more than one TXXX frame : they could be returned as a a line list of strings

==============
WHAT FUNCTION :

get ID3what (mp3FilePath)

-- returns a list of frame codes available in an unknown mp3 file, like "TALB,APIC,TIT2,TPE1,TXXX yz,USLT"
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Klaus
Posts: 11332
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: ID3 tags : a New LC Lib ?

Post by Klaus » Sat Nov 02, 2019 2:35 pm

Bonjour Eric,

maybe version 1.0.3 is of more help?
https://github.com/PaulMcClernan/id3lib


Best

Klaus

Eric_Taquet
Posts: 23
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

Re: ID3 tags : a New LC Lib ?

Post by Eric_Taquet » Mon Nov 04, 2019 6:46 pm

Bonjour Klaus ! Merci pour ta réponse !

I've not yet tested this 1.0.3 version … But, on the web page you indicate, Paul McClernan writes that there still exist problems with read/write picture frames. And I need this function. It seems Paul McClernan has not published more recent versions that this one in 2015 … ?

Thierry DOUEZ, a french freelance LC developer, has replied to my post … He checks if he can do this library! If he can,I hope his price will be reasonable ;-)

Merci … bien amicalement … Éric
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Klaus
Posts: 11332
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: ID3 tags : a New LC Lib ?

Post by Klaus » Mon Nov 04, 2019 7:23 pm

With Thierry you are in good hands!

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Tue Nov 19, 2019 11:20 pm

Hi,
Paul McClernan here...
That is correct, there is still problems writing picture frames (and reading certain pictures too, although I included a little hack to work around that in my version). Also correct that I haven't done anymore with updating Mark Smith's Library since since 2015. I think the difference is between ID3 2.3 versus 2.4 is more tags, and ID3v2.3 the use of Unicode-16 while ID3v2.4 uses Unicode-8. It seems like 2.4 never really took off as the standard even though 2.4 has been around for a long time now. I don't think it would be too hard to add these things to Mark's library, it's just that I'd lost interest in working on it and I was concentrating on other things (like LiveCode Builder, which may be a better way to go instead of Mark's pure LiveCode Script library, maybe using LCB FFI to wrap an existing and up to date code library or OS API's for handling mp3s/ID3)
https://github.com/PaulMcClernan/

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Wed Nov 20, 2019 2:40 am

Hmmm, it seems there aren't as many libraries available as I'd thought, the command line tools and libraries that are around are really older and don't seem to handle images or ID3v.2.4. Even Apple's AVFoundation / AVAsset stuff it seems are read only for mp3's (due to copyright or licensing issues?). Perhaps I will take another crack at updating Mark Smith's Library to include write support for embedding images.
https://github.com/PaulMcClernan/

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Thu Nov 21, 2019 3:34 am

I found on my hard drives a slightly newer versions I'd made of Mark Smith's id3 Library and Demo stack, both tagged as v1.0.4b. I've just now uploaded them to my git hub repo. I also uploaded my original attempt to create an mp3 parsing stack that I had started working on prior to finding Mark Smith's Library. That file is called "Mp3ID3FramesReader.6.livecode"
https://github.com/PaulMcClernan/

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Sat Nov 23, 2019 9:08 pm

Eric_Taquet wrote:
Sat Nov 02, 2019 12:49 pm
WRITE FUNCTION :
get ID3write (tArray, mp3FilePath)
-- tArray is like (no limit for number of keys=frameCodes, no order) :
key value
"TALB" "My new sound project"
"TDRC" "2019"
"APIC" imageFilePath
"TXXX" "projectid", "xYz-12"
… …
-- for T text frames, the text encoding description byte must be $01 (UTF-16) because a lot of frequently used chars in various langages are not in ISO 8859-1 (encoding byte $00), like œ in french and all chars with diacritic
-- ID3write() returns empty or « error » && a list of error descriptions …
==============
READ FUNCTION :
get ID3read (tagCodes, mp3FilePath, folderPathForAPIC)
-- tagCodes can be any length comma list as : "APIC,COMM,TALB,TCOP,TDRC,TXXX,USLT"
-- ID3read() returns an array like described above
-- for the APIC key, the returned value is a line list of filenames of the image(s) saved in the specified folder
-- for the TXXX key, the result is a text string like : frameDescription tab theValue ; if more than one TXXX frame : they could be returned as a a line list of strings
==============
WHAT FUNCTION :
get ID3what (mp3FilePath)
-- returns a list of frame codes available in an unknown mp3 file, like "TALB,APIC,TIT2,TPE1,TXXX yz,USLT"
I've started working on this ID3 parsing stuff again, as I personally have a desire to clean up the ID3 Tags in a fairly huge mp3 library I have on a 3TB drive. I just now uploaded an updated stack that is a fairly complete, straight-through/top-down ID3 TAG dumping (it dumps all ID3 frames regardless of what they contain) and 1st-MP3-Frame reading (for getting basic audio encoding info; bitrate, joint-stereo, etc.) parser. It's not (yet) in any function-library type of form, it's just one long routine. Basically a learning (or re-learning) process for me to get reacquainted with the file formatting. The good news is it seems to extract the Image Data correctly for every mp3 I'vet thrown at it so far (including ones that failed with Mark's id3Lib Library).

I don't think the functions you would like would be do-able in the way that you've specified here. The arrays would have to be multi-dimensional because many types of frames, like 'PRIV','COMM',etc. (not just 'APIC'), can appear more than once in a tag, so for example to get all of the comment tags contents ("COMM") it would be something like: put tagCodes["COMM"][1] into fld "myField" -- for the first comment, tagCodes["COMM"][2] -- for the second, etc. I can't see having it return just one that contains a line for each occurrence because 'COMM' and others tag frames can themselves contain multiple lines.
Last edited by PaulDaMacMan on Sun Nov 24, 2019 5:13 pm, edited 1 time in total.
https://github.com/PaulMcClernan/

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Sat Nov 23, 2019 11:03 pm

For writing the tag back out to the mp3 it will probably be best use a temp file, write the new tag and then write the mp3 audio from the original file to the new file. I'm pretty sure that's the way iTunes does it. This is because only way to update the existing file is if the new tag data total size is equal to or smaller than the old tag data size and then pad any remaining bytes to retain the same size as the original file, if you add data making the tag larger than the original then I'm pretty sure you have to rewrite the entire file.
https://github.com/PaulMcClernan/

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Sun Nov 24, 2019 5:19 pm

BTW, Mark Smith's Library is id3v2.4 compatible (in fact I've had more trouble dealing with PIC frames in id3v2.3 tagged files), I'm not sure why you would say it wasn't?
https://github.com/PaulMcClernan/

Eric_Taquet
Posts: 23
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

Re: ID3 tags : a New LC Lib ?

Post by Eric_Taquet » Sun Nov 24, 2019 7:23 pm

Hello everyone
I'm sorry: I'm overworked ... I'll read you more carefully in a week! I see that solutions seem emerging for my projects and ID3 needs! THANK YOU !
Éric
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Thunder
Posts: 13
Joined: Thu Mar 12, 2015 1:52 pm

Re: ID3 tags : a New LC Lib ?

Post by Thunder » Sun Nov 24, 2019 11:13 pm

Hi.

Could this tool be of any help : ExifTool by Phil Harvey

Link : https://owl.phy.queensu.ca/~phil/exiftool/

( Command-line application for reading, writing and editing meta information in a wide variety of files. ExifTool supports many different metadata formats including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the maker notes of many digital cameras by Canon, Casio, DJI, FLIR, FujiFilm, GE, GoPro, HP, JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Motorola, Nikon, Nintendo, Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Phase One, Reconyx, Ricoh, Samsung, Sanyo, Sigma/Foveon and Sony.)
Eric_Taquet wrote:
Sat Nov 02, 2019 12:49 pm
Hi all !

I'm looking for someone who could make me a library / external to manage ID3 tags, or tell me where I can find something equivalent.

I looked at id3lib v1.0.0, but it is old, not compatible with id3v2.4, and too complex to use. I am looking for something very simple, with only 3 functions: read, write, and what.

I detail below the specifications for this development.

I do not have enough time, and not enough skill to do that.

I run a French non-profit association, which works in the field of visual disability. I can use a little money to pay an annual license, for example, if it is not too expensive ;-)

With LC 9.5 Indy, I'm developing two independent applications:
- one to produce commercial sound libraries that must be tagged with ID3;
- the other to manage two big mp3 album collections (a music album collection, and one of audiobooks) that need to be better organized and easily manageable.

Thank you for your help!
Éric

===============
WRITE FUNCTION :

get ID3write (tArray, mp3FilePath)

-- tArray is like (no limit for number of keys=frameCodes, no order) :
key value
"TALB" "My new sound project"
"TDRC" "2019"
"APIC" imageFilePath
"TXXX" "projectid", "xYz-12"
… …
-- for T text frames, the text encoding description byte must be $01 (UTF-16) because a lot of frequently used chars in various langages are not in ISO 8859-1 (encoding byte $00), like œ in french and all chars with diacritic
-- ID3write() returns empty or « error » && a list of error descriptions …

==============
READ FUNCTION :

get ID3read (tagCodes, mp3FilePath, folderPathForAPIC)

-- tagCodes can be any length comma list as : "APIC,COMM,TALB,TCOP,TDRC,TXXX,USLT"
-- ID3read() returns an array like described above
-- for the APIC key, the returned value is a line list of filenames of the image(s) saved in the specified folder
-- for the TXXX key, the result is a text string like : frameDescription tab theValue ; if more than one TXXX frame : they could be returned as a a line list of strings

==============
WHAT FUNCTION :

get ID3what (mp3FilePath)

-- returns a list of frame codes available in an unknown mp3 file, like "TALB,APIC,TIT2,TPE1,TXXX yz,USLT"

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Mon Nov 25, 2019 2:56 am

Thunder wrote:
Sun Nov 24, 2019 11:13 pm
Hi.

Could this tool be of any help : ExifTool by Phil Harvey

Link : https://owl.phy.queensu.ca/~phil/exiftool/

( Command-line application for reading, writing and editing meta information in a wide variety of files. ExifTool supports many different metadata formats including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3,
exiftool CLI only reads ID3 tags, it doesn't allow for writing them.
https://owl.phy.queensu.ca/~phil/exifto ... /ID3.html
BTW, I'm pretty sure there is some LiveCode stack / library floating around the net doing with Exif data from picture files.
https://github.com/PaulMcClernan/

PaulDaMacMan
Posts: 209
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: ID3 tags : a New LC Lib ?

Post by PaulDaMacMan » Wed Nov 27, 2019 7:48 pm

OK so If anyone is interested, I've decided to make a new library for doing stuff with mp3s because Mark's Smiths library is oriented to just ID3 tags and I think I want something more than that. Also I think I have different design goals than he did. Besides being able to read / write / update (maybe) the tags, I want to be able to completely strip any tag information or any other non-MPEG data in a file as quickly possible and then write my own along with the original MPEG Audio Data. I want to be able to get the length in time and mp3 encoding information from the MPEG Audio Data (Frequency Info, Bit Rate, VBR/CBR, etc.). I want to be able to scan through an extremely large library of files detecting certain aspects of the file without parsing everything about the file. I've already fleshed out some of this. The new work I'm doing is in that same id3 github repo, now in a stack called mp3Tools.livecode which I think will be the name of the library when I'm done with it.
https://github.com/PaulMcClernan/

Post Reply

Return to “Feature Requests”