Author Topic: NEW: Tags Library  (Read 50031 times)

EWeiss

  • Posts: 333
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: 19
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: 868
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: 19
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: 333
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: 19
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: 868
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: 868
Re: NEW: Tags Library
« Reply #382 on: 22 Feb '17 - 00:11 »
Please re-download the update, added some more fixes.

udo

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

Steve Grant

  • Posts: 136
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: 868
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: 136
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.