Author Topic: Tags Library  (Read 63317 times)

EWeiss

  • Posts: 355
Re: NEW: Tags Library
« Reply #375 on: 20 Feb '17 - 14:21 »
i have captured a wav File from my Music CD
after that add the Tag with TagsLib and add Cover to
you see on my Shot without any Trouble.

i can no more do as testing ;)

greets

udo

  • Posts: 29
Re: NEW: Tags Library
« Reply #376 on: 20 Feb '17 - 14:37 »
i have captured a wav File from my Music CD
after that add the Tag with TagsLib and add Cover to
you see on my Shot without any Trouble.

i can no more do as testing ;)

greets

Thanks for your help. Maybe removing tags is not like use a virgin file  :) I will try that.

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #377 on: 20 Feb '17 - 20:05 »
TagsLibrary_Save() will first try to save the tag format that was loaded. If there was no tag loaded, the second try is to detect the audio file format and decide the tag type(s) to save from that. Then the file extension is examined.
If you use 'ttAutomatic' for WAV files an ID3v2 and a WAV tags will both be saved. Is you specify a format explicitly then that format will be saved only.

To explicitly save the tags with a particular format use:

Code: [Select]
TagsLibrary_Save(..., ttID3v2);

or to save only WAV tags:

Code: [Select]
TagsLibrary_Save(..., ttWAV);

If you use 'ttAutomatic' for WAV files, an ID3v2 and a WAV tags will both be saved.

Note that cover art is only supported for ID3v2.

You can also save both tags indiviudaly by calling 2 saves one after the other:

Code: [Select]
TagsLibrary_Save(..., ttID3v2);
TagsLibrary_Save(..., ttWAV);

Then you can be sure both tags will exist in the file.

Check the TTags.SaveToFile() in TagsLibrary.pas line 2345 on how the save function works.
« Last Edit: 20 Feb '17 - 20:16 by 3delite »

udo

  • Posts: 29
Re: NEW: Tags Library
« Reply #378 on: 21 Feb '17 - 10:31 »
Thank you.
Code: [Select]
TagsLibrary_Save(..., ttID3v2);
TagsLibrary_Save(..., ttWAV);
This works now.
But i still have the problem that Files what are already tagged with another program give back TAGSLIBRARY_ERROR_CORRUPT at
TagsLib.TagsLibrary_Save and TagsLib.TagsLibrary_RemoveTag
Also the tags arent shown.

Is my sample-file really tagged at the wrong way, means Mp3Tag isnt right?  http://www.udoassmus.bplaced.net/01.zip

« Last Edit: 21 Feb '17 - 10:35 by udo »

EWeiss

  • Posts: 355
Re: NEW: Tags Library
« Reply #379 on: 21 Feb '17 - 10:55 »
your should remove the Tag with the same Mp3Tag-Application which has create it.
After that use TagsLib.

Your Tag is written at end of the File.
And TagsLib add it on First line

greets
« Last Edit: 21 Feb '17 - 11:00 by EWeiss »

udo

  • Posts: 29
Re: NEW: Tags Library
« Reply #380 on: 21 Feb '17 - 11:22 »
your should remove the Tag with the same Mp3Tag-Application which has create it.
Oh, i guess this is impossible. We cannot know how people did tag their files.
Also there are thousends of wav-files wich are tagged by taglib-sharp.dll at the same way.
Try saving, remove tags with old lib then write new with TagsLib is a bit strange.

If i may have a wish: Let TagsLib remove data also from end of the file, that the file isnt corrupt anymore.  :)

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #381 on: 21 Feb '17 - 22:36 »
Here's an update which loads and saves your sample file fine here: Tags Library.zip

Also added "support" of corrupt WAV files too, the code won't consider the file corrupt if there is unknown data at the end of the file.
« Last Edit: 22 Feb '17 - 00:56 by 3delite »

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #382 on: 22 Feb '17 - 00:11 »
Please re-download the update, added some more fixes.

udo

  • Posts: 29
Re: NEW: Tags Library
« Reply #383 on: 22 Feb '17 - 09:20 »
Thats great, thank you  :) :)

Steve Grant

  • Posts: 148
Re: NEW: Tags Library
« Reply #384 on: 26 Feb '17 - 13:46 »
Hi 3delite, I have come across a track that has a tag called Metadata_Block_Picture. This tag must be huge because TagsLib takes ages to return from reading it. I have tried the track in: dBpoweramp and mp3tag and both return instantly with the contents of Metadata_Block_Picture simply truncated to fit the textbox.

Is it possible to adjust something in TagsLib to accomodate items like this?

Removed URL.
« Last Edit: 27 Feb '17 - 10:10 by Steve Grant »

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #385 on: 26 Feb '17 - 19:27 »
Tried the MP3 with the ID3v2 Tutorial and both Tags Library Delphi and the DLL tutorial and all of them read the file instantly.

Are you sure you don't do something time consuming in your code? This is a TXXX frame, that is meant for text information, maybe you do some string processing that's not expecting a long string!?

Steve Grant

  • Posts: 148
Re: NEW: Tags Library
« Reply #386 on: 26 Feb '17 - 21:11 »
At the point it takes a long time, I am looping through the tags and putting them in a Textbox. I have just tested again and if I omit the loading of the textbox then, as you say, it is instant.

My apologies, I will try a StringBuilder to see if that helps.


zittergie

  • Posts: 31
Re: NEW: Tags Library
« Reply #387 on: 30 May '17 - 19:38 »
Hello 3delite,

If you don't mind I would like to ask for your help reading OPUS Tags (Comments).
I am using Lazarus and I am programming a Opus Tag Reader Unit.
Reading the Tags is fairly simple.  The 4 bytes before the field give you the length, so reading the tags is easy.

The problem is when I encounter METADATA_BLOCK_PICTURE.  The 4 bytes before this field is not the length of this field.
I would like to skip this tag and read on to the other tags, but it seems that you cannot get the length of this field easy.

Can you help me further on how to achieve this?

Greetz,
Bart

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #388 on: 31 May '17 - 18:49 »
A quick look at the sources, maybe the problem is that the cover art frame spans multiple Ogg pages. The Ogg page headers are not included in the "size" field.
There is a Ogg Streamer Library that is not adjusted for Lazarus, but with a little modification might work and help you if you want to simplify OGG stream reading.

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #389 on: 31 May '17 - 19:17 »
Adjusted my library to Lazarus: OggVorbisAndOpusTagLibrary.pas
Not tested though, but needed very few changes...
And the streamer too: OGGStreamerLibrary.pas

:)
« Last Edit: 31 May '17 - 19:24 by 3delite »

zittergie

  • Posts: 31
Re: NEW: Tags Library
« Reply #390 on: 31 May '17 - 20:14 »
Adjusted my library to Lazarus: OggVorbisAndOpusTagLibrary.pas
Not tested though, but needed very few changes...

Compiles without problems in Lazarus.
Just did a quick test with Lazarus (MacOS X) and it seems to work very fine.

Thanks.
« Last Edit: 31 May '17 - 20:46 by zittergie »

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #391 on: 31 May '17 - 22:14 »
Ok, it's cool then. :)
« Last Edit: 1 Jun '17 - 04:03 by 3delite »

zittergie

  • Posts: 31
Re: NEW: Tags Library
« Reply #392 on: 1 Jun '17 - 09:33 »
Reading CD Cover Image from METADATA_BLOCK_PICTURE works very fine too.

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #393 on: 1 Jun '17 - 16:01 »
Ok. BTW I updated the whole package is now Lazarus/Free pascal compatible, although the Lazarus/Free pascal build is very little tested. Also the ID3v2, MP4 and Flac reading/writing should be a bit faster (a buffered stream is used).

zittergie

  • Posts: 31
Re: NEW: Tags Library
« Reply #394 on: 1 Jun '17 - 20:25 »
Thanks,

I am going to test them out, and probably going to replace the ATL units with your units.  I let you know.
I am using Trunk Lazarus and FPC 3.0.2 on Linux (Intel & ARM), MacOS and Windows.

Writing Picture to Opus/Vorbis Tags work very fine too.

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #395 on: 10 Jun '17 - 19:39 »
The package has been updated to 1.0.60.102 with many little fixes and improvements:
  • Fixed all hints and warnings for Tokyo
  • Improved Lazarus/Free pascal compatibility
  • WMVCORE.DLL is only loaded on first WMA load/save
  • Various small fixes and improvements
Please see the first post for download!

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #396 on: 11 Jun '17 - 21:20 »
Update 1.0.61.104:
  • Fixed TOpusTag.SetAsList()
  • Fixed ID3v1 and ID3v2 strings with localized ANSI characters
  • Added Lyrics tag loading for ID3v1Tag.LoadFromStream()
  • Fixed a memory leak in ID3v1Tag when Lyrics tags have been loaded

firstname

  • Posts: 10
Re: NEW: Tags Library
« Reply #397 on: 22 Jun '17 - 13:03 »
3delite, hi, is there any chances you going implement open lastfm support at least scrobbling and within Tags package?

Including Delphi headers?

I was looking over the net and didn't find any appropriate stuff for that.

Question to Ian, XMPlay clean has support for lastfm, and I am surprised Bass still doesn't, any plans for that, if any?

« Last Edit: 22 Jun '17 - 14:42 by firstname »

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: NEW: Tags Library
« Reply #398 on: 22 Jun '17 - 15:00 »
Question to Ian, XMPlay clean has support for lastfm, and I am surprised Bass still doesn't, any plans for that, if any?

XMPlay itself doesn't include support for lastfm, but users have created plugins for it. There have been a few different plugin versions/developers over the years. I think this is the latest project:

   https://gitlab.com/taz007/xmp-scrobbler

3delite

  • Posts: 907
Re: NEW: Tags Library
« Reply #399 on: 23 Jun '17 - 02:44 »
3delite, hi, is there any chances you going implement open lastfm support at least scrobbling and within Tags package?

Including Delphi headers?

I was looking over the net and didn't find any appropriate stuff for that.

No plans for it currently, sorry, but if you would provide a documentation, I would take a look at it.