How to use taglib with jscript?

Hi,

is there a technique or way to use http://taglib.github.io/ which is written in C++ with jscript?

I've written my own jscripts which reads the data as I want from discogs but to write all possible file formats and tags it is only possible with taglib(?).

Or is it better to use ActivePerl with http://search.cpan.org/~gleach/Audio-TagLib/ for script buttons?

Thanks a lot!

It doesn't appear there are language bindings for jscript. You may find the ActivePerl approach challenging when dealing with wide characters. The Dynamic Renamer in this subforum explains what is necessary to make that work.

There are media taggers available that pull from discogs. I also have a very comprehensive discogs puller, which writes to JRiver's Media Center. Ask if you're interested.

Do you need to work with formats that Opus's built-in tagging can't handle? (It's already based on a version of taglib.)

Thanks a lot!

I'm still using Tag & Rename because of various problems (e.g. TDRC/TDRL problem - not tested until yet with JR 21).

I have to rip over 20.000 CDs from the basement, keep data up-to-date from discogs and the overhead must be reduced as much as possible. So I want to program around myself to be more flexible depending on what I need (preparing the data as I want). So no "normal" tagger could be used.

Another solution could be to export a xls or csv from Tag & Rename, update the file (meta data) depending on my discogs & my logic incl. some auto-corrections, etc. and then import the xls in Tag & Rename which updates all the files.

Of course - best would be DOpus could support the following and I could write directly from my script without any problems and overhead. :slight_smile:

Yes, "mp4" (music video) and "wav" (audio/ID3v2). Requested it 2 times a longer time ago. :wink:

I also would need much more columns from ID3v2.3/4 - here is my list which I'm currenty using:

"how I use it"       |   ID3v2  | ID3v2 meaning | DO status
Track Artist         |   TPE1   | Artist        | ok
Track Title          |   TIT2   | Title         | ok
Track Mix            |   TPE4   | Remixed by    | missing
Track Duration       |   TLEN   | Time          | ok
Track BPM            |   TBPM   | BPM           | ok
Track Musical Key    |   TKEY   | Initial Key   | ok
Track Release Year   |   TDRC   | Year          | ok
Track Genre          |   TCON   | Genre         | ok
Track Groups         |   TIT1   | Grouping      | missing
Track Levels         |   TCOM   | Composer      | missing
Track Comment        |   COMM   | Comment       | ok
Track Mastering      |   TENC   | Encoded by    | ok
Track Vendor         |   TPE3   | Conductor     | missing
Track Codec          |   ----   | Encoder       | ok
Track Bitrate        |   ----   | Bitrate       | ok
Track Sample Rate    |   ----   | Hz            | ok
Track Number         |   TRCK   | Track #       | ok
Product Id           |   TPUB   | Label         | missing
Product Artist       |   TPE2   | Album Artist  | ok
Product Title        |   TALB   | Album         | ok
Product Release Year |   TDRL   | Release Time  | ok
Tag Version          |   ----   | Tag Version   | missing
                     |   TIT3   | Subtitle      | later
Track Rating         |   POPM   | Rating        | later (maybe)
                     |   TPOS   | Disc #        | ok
                     |   TOPE   | Orig. Artist  | later

missing = currently using and must be required
later = planned for later

Partially I have some mp3 where no wav is/was available or mastering is better as I have at the moment.

Thanks a lot.

PS: Please don't ask why I don't use lossless flac or aac. It is as it is with mp4 and wav. :slight_smile:

PSS: Of course there is no problem to re-program taglib in jscript I think so far (except I would need more time) - but adding the missing things in DO is much better for all the other users.

[quote="fuzi1968"]Hi,

is there a technique or way to use http://taglib.github.io/ which is written in C++ with jscript?
[/quote]
If you're able to compile that project yourself (iow, you have the tools and the knowledge), then you could
write an activex/automation/OLE server to expose whatever functionality you need from it (or anything else).

JScript can instantiate those through the use of "new ActiveXObject(progid)".

I looked around a bit, it's really weird that there is no easy way to make full use of taglib in a scripted environment.
The situation did not change. I did a little vbs-based mp3-tag reader and writer to automate processing of tag information some years ago because of that.
It is based on pure vbs-code to read (adopted code, not mine) and an external tool to write the tags (still have it, if you..).

So maybe you also look for specific tools for each filetype that cover what taglib does. You'd still need to write some kind of dispatcher/wrapper of course, but that might be an alternative to getting taglib to compile on windows and creating the activex/com-wrapper for it.

For getting mp4 or video metadata e.g., the ffmpeg suite has a dedicated tool to parse and export metadata in various formats (xml, json, csv etc). It works quite good. It seems writing of tags can be done with ffmpeg as well, don't know how many of your desired tags are supported though.

I also find the activex-dll solution mentioned by myarmor to be the best, but maybe that "available external tool" approach is worth investigating as well, as long as nobody is jumping the gun and starting to code the taglib-wrapper dll.

@fuzi1968,

So this thread and the videos posted in post #1. This might be something you're interested in.

Once you've retried the Discogs album release id, you can always re-retrieve the information in the future should you need to. When I rip new CDs, I immediately go to the Discogs page (and AMG page) and retrieved the release ID. I supply this to the script, and it fills in all the information I want.

[quote="myarmor"]If you're able to compile that project yourself (iow, you have the tools and the knowledge), then you could
write an activex/automation/OLE server to expose whatever functionality you need from it (or anything else).

JScript can instantiate those through the use of "new ActiveXObject(progid)".[/quote]

During looking around I've found/read something about that to use it as ActiveXObject on msdn but couldn't find a full example from how-to start until the end.

But finally I want to avoid a new technique or interface over interfaces when there would be an easier way for ALL(!): => full - and not partial - implementation of taglib in DOpus.

Thanks for video - will watch it in a few minutes.

I'm doing the same as you:

[ul]
[li] I take the CD[/li]
[li] search on discogs for the relesae id[/li]
[li] create a directory with the release id[/li]
[li] rip the files with EAC (exact audio copy) into this directory (incl. subdirs CD1, DVD1, etc if required)[/li]
[li] then I select the directory and press the button for my script in DOpus[/li]
[li] and ... voilĂ ! Files renamed based on "TrackPos_Artist_Title_(Mix)_[DgsReleaseId]_ProductReleaseYear" (directory the same without "Mix")[/li][/ul]

After I have ripped an amount of CDs, I start Tag & Rename and update the tags based on the file names. Update of directory/album data not possible because most of the time I run out of the max allowed length of path+file name but could done in an extra step later (xls export/import as above).

Finally I remove the ProductReleaseYear from the file name. Keys, BPM (update with SeratoDJ), DR/RMS/Peak (update with foobar2000 plugin).

But I also want to keep the archive up-to-date. When I get an update email on a release from discogs, press a button, enter release id and update of data should happen as usual.

If DOpus would support all tags and wav/mp4 (incl. jscript/vbs functions) - I/we could update the files directly with the full information.

@leo: Full - and not partial - implementation of taglib in DOpus (would be really the greatest wish I ever had since I have DOpus).

All could do so much more depending on personal needs without additional extra steps or another software/interface - as you see. :slight_smile:

Update: Just saw the video's: Really great - updating JR MC database and files with taglib (from Perl) :thumbsup: . I've programmed Perl for more than 10 years in our company. JR MC always failed for me because of the TDRC/TDRL problem during reading/writing the data (you know MrC :wink: ). However - I think DOpus has too add the missing columns and supported files sooner or later. I want to see the information in my file manager also (speaking for all). :slight_smile:

@fuzi1968, you would have to expose whatever functionality through IDispatch/IDispatchEx interfaces like usual.
If that project already is an automation server, or have such a wrapper, then you just have to register the dll
(by using regsvr32 or similar).
The objects in it can then be created by using "new ActiveXObject" (AX). AX does the same as VB/Script's CreateObject.

The usage of AX is quite simple:

var fs = new ActiveXObject("Scripting.FileSystemObject");
// do something with the object here.
fs.somefunctionhere();

@fuzi1968, did you manage do use taglib with jscript? There are some MP4 IDv3 tags I wish to use on a jscript too, but that are currently unsupported on Opus.

Hi,

sorry I didn't tried taglib with jscript,

but a longer time ago I've found something to use taglib with jscript and powershell (or shows how it works), but I couldn't find it anymore but I'm sure I have the link somewhere.

It's really sad - DO has a lot of gimmicks to e.g. set colors here and there, etc etc, but can not support all music formats and tags and so all features added since I'm using DO (2005/6?) ... didn't make my daily work easier or are more or less useless.

I still have a big overhead in using Tag & Rename which can not use e.g. favorites (files) - I always have to load the complete archive if I want to change something (currently over 60.000 WAV files).

I can not write my own jscripts using the tagging data inside these files and there is no light in future releases.

DO could be the perfect music & video tagging editor when supporting all possible tags (like taglib) and I would recommend it to all my dj friends and in forums but with these limits it is not possible.

You might ask DO owners - maybe one more request helps to implement it until version 20 or so. :wink:

Opus supports reading and writing tags for lots of audio formats, and you can use the SetAttr META command to set tags from scripts.

If we're talking about tagging wav files, it has only been requested by approximately two people in about 15 years. Maybe one day, but it is rather esoteric and won't be a high priority unless there's more demand. It might happen if we're working on similar code and can quickly add it at the same time as something else.