Javascript to write AIFF metadata (tags)?

Alex_k's icon

I'm looking for a javascript that will allow me to read an AIFF soundfile and write meta tags like:artist, title, comment, album, year, genre.
Thanks

pdelges's icon

AFAIK, you need to write id3 tags into an 'ID3' data chunk.
I _think_ I still have some ugly JavaScript test code somewhere to write AIFF chunks, but I stopped working on this when I noticed that file i/o in JavaScript was extremely slow. I'll check next monday if I can find it.
I could add an ID3 feature into my sfmarkers~ external to read those datas, but unfortunately I don't have much time those days.

Alex_k's icon

Thanks, Patrick.
I'd need something that is cross-platform for my project and I've seen that unfortunately the sfmarkers~ external is only for MacOS and I need to be able to WRITE those metatags, not read them.

I'm no expert when it comes to JS but I'm wondering if it would be possible to use this http://javamusictag.sourceforge.net/ to create a JS that provides this function.

What do you think?

pdelges's icon

The javamusictag library is for Java, not for JavaScript which is an other language. And it seems to be only for mp3 files, not AIFF. But it's probably possible to port it for Max.

Alex_k's icon

Thanks for the clarification!

I've found this porting of taglib in JS
https://github.com/nikhilm/node-taglib

"node-taglib

node-taglib is a simple binding to TagLib in Javascript.

It requires node.js and taglib header files (on Debian systems, install libtag1-dev).

node-taglib offers only an abstract interface without giving access to extended file-specific attributes. It does allow custom resolvers though. Synchronous write support is supported for Tag.

NOTE: Asynchronous API requires use of TagLib from git since certain bugs present in the released v1.7 cause problems."

Will it be possible to use it in Max?

Thanks

pdelges's icon

So, here is the JavaScript code I wrote 10 years ago to add a marker into an AIFF file. It shouldn't be too difficult to adapt but as I wrote earlier it was so slow that I stopped working on this (in the meantime MAx' JavaScript implementation changed). The code is not well documented nor tested. I saw on the dev forum you're looking for a paid developer, it's too bad I have no time for this ;-)

Good luck,

p

Archive.zip
zip
Alex_k's icon

Many thanks for the help, guys!

I was wondering what you think of this Javascript version of taglib
https://github.com/nikhilm/node-taglib

Will it be possible to use that in Max?

Michael Gary Dean's icon

Very useful code. Thank you @Patrick Delges.

pdelges's icon

You're welcome!