Author Topic: Editing Wma Tags  (Read 116232 times)

Philip Hadar

  • Posts: 79
Re:Editing Wma Tags
« Reply #50 on: 30 Jan '04 - 14:20 »
Luq,

Attributes for Music Files
This section lists the attributes commonly used for audio files containing music. It is recommended that you set attributes for files according to these lists to ensure that your files are fully compatible with a wide variety of playback applications. The attributes in this section are listed in three categories: primary, secondary, and tertiary.

Primary attributes convey the most basic information about a file. If you are creating audio files for distribution, this is the minimum set of attributes you should use.

Secondary attributes contain common metadata that is important but not universal to all audio files.

Tertiary attributes should be included as needed, but are not essential to describing the file.

Primary Attributes for Music
Author
Title
WM/AlbumArtist
WM/ContentDistributor
WM/Genre
WM/MCDI (if available; otherwise use WM/WMCollectionID, WM/WMCollectionGroupID, or WM/WMContentID)
WM/MediaClassPrimaryID
WM/MediaClassSecondaryID
WM/Provider
WM/TrackNumber

Secondary Attributes for Music
Copyright
WM/Composer
WM/EncodingTime
WM/Language
WM/ParentalRating
WM/Producer
WM/ToolName
WM/ToolVersion
WM/WMCollectionGroupID
WM/WMCollectionID
WM/WMContentID
WM/Writer
 
Tertiary Attributes for Music
Description
WM/AuthorURL
WM/BeatsPerMinute
WM/Conductor
WM/ContentGroupDescription
WM/EncodedBy
WM/EncodingSettings
WM/InitialKey
WM/Lyrics
WM/Lyrics_Synchronised
WM/Mood
WM/PartOfSet
WM/Period
WM/Picture
WM/PromotionURL
WM/Publisher
WM/SubTitle
WM/UniqueFileIdentifier
WM/UserWebURL
See Also

Now if you decide to set a tag name that is not listed, you'll probably end up either with a file corruption or an exception.
Furthermore, as stated previously, WMA tags structure is not compatible with other format such as Mp3, Ogg... due to fields collision.

So perhaps you should consider talking to big Bill and persuade him to add this fields - who knows...  ;)

Philip
« Last Edit: 30 Jan '04 - 14:21 by Philip Hadar »

MrTDelphi

  • Posts: 111
Re:Editing Wma Tags
« Reply #51 on: 23 Feb '04 - 18:14 »
Hi...

Sorry long to replay this...

Chris..
I think you can rewrite your data what you want as Data File, furthermore
like Dana said
"
Example, an option to "share" this information via meta tags/comments and/or an option to save this information in a database. " in Listbox of Your

and like you said "whats happend if the File is an WavFile ???"
so far if wav field same with mp3 or ogg its ok...

if we have some field (maybe for now its not Starndart "ISO"),  ;D
than you can read  the data for Others Player...

Philip...
I found "Improve ID3v2" after searching at wildword...
and I don't know, if you cek this +- 39 field.
standart what? "Him" used..

Too much someone to make deffrence standart for Tag.

How at this "Place" make New Standart TAG  Who Knows ???

Name is "BASS_TAG"......bla...


// These constants define the different "frames" that can be found in the V2
// tag; all identified by a 4-char code.
const
  TAG_TRACK: Tid3frameid          = 'TRCK'; // Track number/Position in set
  TAG_ENCODER: Tid3frameid        = 'TENC'; // Encoded by
  TAG_URL: Tid3frameid            = 'WXXX'; // url to something
  TAG_COPYRIGHT: Tid3frameid      = 'TCOP'; // Copyright message
  TAG_COMPOSER: Tid3frameid       = 'TCOM'; // Composer
  TAG_COMMENT: Tid3frameid        = 'COMM'; // Comment;
  TAG_YEAR: Tid3frameid           = 'TYER'; // Year (ext)
  TAG_ALBUM: Tid3frameid          = 'TALB'; // Album/Movie/Show title
  TAG_GENRE: Tid3frameid          = 'TCON'; // Content type
  TAG_ARTIST: Tid3frameid         = 'TPE1'; // Lead performer(s)/Soloist(s)
  TAG_TITLE: Tid3frameid          = 'TIT2'; // Title/songname/content description
  TAG_ORGALBUM: Tid3frameid       = 'TOAL'; // Original album/movie/show title
  TAG_ORGWRITER: Tid3frameid      = 'TOLY'; // Original lyricist(s)/text writer
  TAG_ORGARTIST: Tid3frameid      = 'TOPE'; // Original artist(s)/performer(s)
  TAG_BPM: Tid3frameid            = 'TBPM'; // BPM (beats per minute)
  TAG_ENCODINGTIME: Tid3frameid   = 'TDEN'; // Encoding time
  TAG_PLAYLISTDELAY: Tid3frameid  = 'TDLY'; // Playlist delay
  TAG_ORGRELEASETIME: Tid3frameid = 'TDOR'; // Original release time
  TAG_RECORDINGTIME: Tid3frameid  = 'TDRC'; // Recording time
  TAG_RELEASETIME: Tid3frameid    = 'TDRL'; // Release time
  TAG_TAGGINGTIME: Tid3frameid    = 'TDTG'; // Tagging time
  TAG_WRITER: Tid3frameid         = 'TEXT'; // Lyricist/Text writer
  TAG_FILETYPE: Tid3frameid       = 'TFLT'; // File type
  TAG_INVOLVEDPEOPLE: Tid3frameid = 'TIPL'; // Involved people list
  TAG_CONTENTGROUP: Tid3frameid   = 'TIT1'; // Content group description
  TAG_SUBTITLE: Tid3frameid       = 'TIT3'; // Subtitle/Description refinement
  TAG_INITKEY: Tid3frameid        = 'TKEY'; // Initial key
  TAG_LANG: Tid3frameid           = 'TLAN'; // Language(s)
  TAG_LENGTH: Tid3frameid         = 'TLEN'; // Length string in millisecs
  TAG_MUSICIANS: Tid3frameid      = 'TMCL'; // Musician credits list
  TAG_MEDIA: Tid3frameid          = 'TMED'; // Media type
  TAG_MOOD: Tid3frameid           = 'TMOO'; // Mood
  TAG_BAND: Tid3frameid           = 'TPE2'; // Band/orchestra/accompaniment
  TAG_CONDUCTOR: Tid3frameid      = 'TPE3'; // Conductor/performer refinement
  TAG_INTERPRETED: Tid3frameid    = 'TPE4'; // Interpreted, remixed, or otherwise
                                           // modified by
  TAG_PARTOFSET: Tid3frameid      = 'TPOS'; // Part of a set
  TAG_PUBLISHER: Tid3frameid      = 'TPUB'; // Publisher
  TAG_ORGFILENAME: Tid3frameid    = 'TOFN'; // Original filename
  TAG_OWNER: Tid3frameid          = 'TOWN'; // File owner/licensee


Sorry if my word have not comport with or (match)...


Best,

LuQ

Chris

  • Posts: 1810
Re:Editing Wma Tags
« Reply #52 on: 29 Feb '04 - 16:34 »
Hi
I have here a little Prob with the DLL that i can`t so right understand

I`m loading the dll dynamic

The problem is   after I will free the dll  i will became a
ntdll.dll  Error Message

ntdll.DbgBreakPoint
Int 3
Ret    >>>>   Here will come the crash


here the complede code

Code: [Select]

unit CST_WMA_Utils;

interface

uses

  Windows, SysUtils, Dialogs;

type

  TTagsData = packed record
    Encoder, Version, Genre, Author, Title, Album,
    Composer, Url, Track, Year, CopyRight: string[255];
    Comments, Lyrics: WideString;
    Duration, BitRate, FileSize: LongInt;
    VBR: Boolean;
  end;

  PTagsData = ^TTagsData;

var
  ShowTags: function(var FileName: PWideChar; var TagsData: PTagsData): Boolean; stdcall;
  SaveTags: function(var FileName: PWideChar; var TagsData: PTagsData): Boolean; stdcall;
  TagDLL_Handle: THandle = 0;



function  LoadWMATagDataDLL: boolean;
procedure FreeWMATagDataDLL;
function  IsTagDataDLLLoaded: boolean;
function  DurationToStr(Duration: integer; ShowMs: boolean): string;
function  ProgDir: string;


implementation

procedure FreeWMATagDataDLL;
begin
  if (TagDLL_Handle <> 0) then begin

     FreeLibrary(TagDLL_Handle);
    TagDLL_Handle := 0;
  end;
end;

function LoadWMATagDataDLL: boolean;
var oldmode: integer;
begin
  if TagDLL_Handle <> 0 then Result := true //(is it allready here)
  else begin
    oldmode := SetErrorMode($8001);
    TagDLL_Handle := LoadLibrary(PChar(progdir+'MetaData.dll'));
    SetErrormode(oldMode);
    if TagDLL_Handle <> 0 then
    begin
      @ShowTags := GetProcAddress(TagDLL_Handle, 'ShowTags');
      @SaveTags := GetProcAddress(TagDLL_Handle, 'SaveTags');
      if (@ShowTags = nil) or
        (@SaveTags = nil)
        then begin
        FreeLibrary(TagDLL_Handle);
        TagDLL_Handle := 0;
      end;
    end;
    Result := (TagDLL_Handle <> 0);
  end;
end;



function IsTagDataDLLLoaded: boolean;
begin
  Result := (TagDLL_Handle <> 0) or (@ShowTags <> nil) or (@SaveTags <> nil);
end;

function DurationToStr(Duration: integer; ShowMs: boolean): string;
begin
  if ShowMs then
    Result := Format('%d:%2.2d,%3.3d', [(Abs(Duration div 60)), Abs(Duration mod 60), Abs(Duration mod 1000)])
  else
     Result := Format('%d:%2.2d', [(Abs(Duration div 60)), Abs(Duration mod 60)]);
end;

function ProgDir: string;
begin
  Result := ExtractFilePath(ParamStr(0));
end;
end.



Greets Chris
« Last Edit: 29 Feb '04 - 20:58 by Chris »

DanaPaul

  • Posts: 335
Re:Editing Wma Tags
« Reply #53 on: 1 Mar '04 - 03:18 »
Chris,

Variables @ShowTags and @SaveTags are undefined when function IsTagDataDLLLoaded is called.  Consequently, this function will always return true (as written) after checking (undefined) var's @ShowTags and @SaveTags.

Try this...

function IsTagDataDLLLoaded: boolean;
begin
  Result := (TagDLL_Handle <> 0) and (@ShowTags <> nil) and (@SaveTags <> nil);
end;
« Last Edit: 1 Mar '04 - 03:27 by DanaPaul »

Chris

  • Posts: 1810
Re:Editing Wma Tags
« Reply #54 on: 1 Mar '04 - 20:02 »
Hi

@ Dana  thanks    will working.....

to all Delphianer    here is a modification of Phillips Source-Code

At first   No MetaData .dll  is needed

you can Load / Save Tags direct from your form (the only needed is an installed WMA Codec)

You can download it here   (icl.   Example)

http://playcenter.dyn.ee/delphi/WMA_Tag_Writer.zip]


Greets chris
« Last Edit: 1 Mar '04 - 20:11 by Chris »

DanaPaul

  • Posts: 335
Re:Editing Wma Tags
« Reply #55 on: 4 Mar '04 - 15:39 »
Too much someone to make deffrence standart for Tag. ... How at this "Place" make New Standart TAG  Who Knows ??? ... Name is "BASS_TAG"......bla...

I have a total of 51 ID3v3 standard tags defined, some of these tags equate with other standards, EG: Vorbis, WMA, ID3v2, ID3v4.  Generally, tags that can cross reference these standards may support media file format conversions, in its most basic implementation.  However, more specifically, tags that cross reference standards support cross pollination, EG: WMA encoded audio files have been found to include a Meta Data item named "ID3" and this binary meta tag is a complete ID3 tag frame including ID3 tags "APIC", "TCON", "TLEN", "TPE1", "TIT2" and 1225 bytes of padding.  IMHO, a complete tag editor or audio player will support this cross pollination described here as well as the WMA Meta tags populating MP3 audio format ID3 frames described in an earlier post.

Defining a standard tag for Equalization properties may simply define how these different audio files will hold this data.  For instance, Vorbis does not support binary "Vorbis Comment" data.  In that vein, defining a data storage format (standard) that is compatible with all (most) audio file formats may conclude that a Hexadecimal Ansi string will suffice.  If this is the case then this standard will publish a "Private" or "Custom" tag that is compatible with all (Bass) applications that are aware of this published standard.

On the other hand, because ID3 does in fact have an Equalizer tag declared then it may become the conclusion of this forum that our standard will support this ID3 tag currently defined, and other formats will have a new standard.

Dana

MrTDelphi

  • Posts: 111
Re:Editing Wma Tags
« Reply #56 on: 9 Mar '04 - 18:22 »
Dana...
would you like to post it Id3v3 to me.
hei..I have improve Id3v2 from Jfaul then add new frame
like i want(not standart), Cue/Intro, sequen, starttime, endtime.

I think if you or delphianer  now make project like RadioDj or RadioOnAir its have beneficial...
I hope....

if you have that data from Tag file, it can fallin your "playlist database"
like Listview, listbox everything before you saveit or not then its can minimized of "BIG" database.
i like said the Tags is "mobile/Portable database"....one file have much info...


Best Regards

LuQ :D

DanaPaul

  • Posts: 335
Re:Editing Wma Tags
« Reply #57 on: 10 Mar '04 - 03:51 »
would you like to post it Id3v3 to me.
hei..I have improve Id3v2 from Jfaul then add new frame
like i want(not standart), Cue/Intro, sequen, starttime, endtime.

I am working with ID3v4, with backward compatibility for all older ID3 versions.

I will post example project soon, many units.  Each audio format has at least 2 units, object (TCollection) inheritance, a text encoding unit, and a wrapper unit (class) that manages subtle differences between each audio file (tag) format.  WMA format is a lot of work to get core object up and running, and Ogg format has developed a "click" and a (sigh) bug.

My apologies for not posting example project by this date, life is busy, back home after 3 month stay away from home, etc.


MrTDelphi

  • Posts: 111
Re:Editing Wma Tags
« Reply #58 on: 10 Mar '04 - 04:55 »
I 'll waiting for that...and I hope get final soon..

Thanks before..

Best Regards

LuQ

No_One

  • Guest
Re: Editing Wma Tags
« Reply #59 on: 15 Jan '05 - 18:23 »
Any source code examples in c++?? (Borland c++ Builder) ????

ToRoman

  • Guest
Re:Editing Wma Tags
« Reply #60 on: 15 Jan '05 - 22:55 »
Hi

@ Dana  thanks    will working.....

to all Delphianer    here is a modification of Phillips Source-Code

At first   No MetaData .dll  is needed

you can Load / Save Tags direct from your form (the only needed is an installed WMA Codec)

You can download it here   (icl.   Example)

http://playcenter.dyn.ee/delphi/WMA_Tag_Writer.zip]

Greets chris

Chris, can't download it from this URL.
Please send it me at x-developer(at)inbox.ru.
Thanks a lot!

Chris

  • Posts: 1810
Re: Editing Wma Tags
« Reply #61 on: 15 Jan '05 - 23:12 »
Hi
oops  yup that was my old HP
here you can download it
http://playcenterpro.ath.cx/bass_samples/WMAReader.pas
Greets Chris

ToRoman

  • Guest
Re: Editing Wma Tags
« Reply #62 on: 16 Jan '05 - 01:17 »
Hi
oops  yup that was my old HP
here you can download it
http://playcenterpro.ath.cx/bass_samples/WMAReader.pas
Greets Chris
Thank you very much!

ToRoman

  • Guest
Re:Editing Wma Tags
« Reply #63 on: 16 Jan '05 - 01:21 »
I Improved J. Faul's OggVorbis.Pas as follow:
Added property Composer, Copyright, Url, Lyrics.
Modified property comments - SizeOf from 250 Chrs to 5000 Chrs

www.everx.co.il/delphi/oggvorbis.pas

Also improved, J. Faul's ID3v2.Pas as follow:
Added property Lyrics
Modified property comments - SizeOf from 250 Chrs to 5000 Chrs.

www.everx.co.il/delphi/ID3v2.pas

I will post both units to Mac site
Philip, unfortunately didn't find any improvements on the mac's site , wanted to get it from your site but have an server error. Could you please send me both units to x-developer(at)inbox.ru?
Thanks a lot!

Chris

  • Posts: 1810

ToRoman

  • Guest

Cool_bombom

  • Guest
Re:Editing Wma Tags
« Reply #66 on: 30 Jan '05 - 11:59 »
hi. could you send an example of how you got your application to write to wma.

thnx ahead.

many greetings
Cool_bombom

MrTDelphi

  • Posts: 111
Re: Editing Wma Tags
« Reply #67 on: 30 Jan '05 - 14:32 »
hi Chris..
I was tried your WMA_Tag_Writer.zip, but  I still have
a problem wit get duration for some files I get its wrong
duration I dont know why can like this, it I compare with
w-amp ot the ohers

Thanks n Best,
LuQ


Chris

  • Posts: 1810
Re: Editing Wma Tags
« Reply #68 on: 30 Jan '05 - 16:42 »
Hi
oops  yup i have dedected that there is an Error hold on  i will fix that fast
Greets Chris

thats strange   with WMA VBR`s it will show the right Duration only on none VBR`s it will show the wrong Duration
a fix will come soon....
Greets Chris


« Last Edit: 30 Jan '05 - 16:56 by Chris »

MrTDelphi

  • Posts: 111
Re: Editing Wma Tags
« Reply #69 on: 1 Feb '05 - 05:16 »
okeh...I'll wait for... soon  ;)

Best,
LuQ

Chris

  • Posts: 1810
Re: Editing Wma Tags
« Reply #70 on: 1 Feb '05 - 08:31 »
Hi
So here is the BugFix...
Now the Duration was not reading from the header it was calculated.
You can downlod the New Heder
here
Greets Chris

@Cool_bombom

to read/write WMA Tag Infos do the following
Code: [Select]
// read

procedure ReadWMAFile;
var
  TagsData: PTagsData;
begin
   New(TagsData);
   try
      OpenWMAFile(FileName, TagsData);
      //now  read the TagsData Infos
     // Example
       edit1.Text := DurationToStr(TagsData.Duration, true) + ' sec ';
   finally
     Dispose(TagsData); 
end;

Code: [Select]
// write the Data

procedure TTagEdit.WriteWMAFile;
var
  TagsData: PTagsData;
begin
  New(TagsData);
  try
    TagsData.Encoder := edEncoded2.Text;
    TagsData.Genre := cbGenre2.Text;
    TagsData.Author := edArtist2.Text;
    TagsData.Composer := edComposer2.Text;
    TagsData.Title := edTitel2.Text;
    TagsData.Album := edAlbum2.Text;
    TagsData.Year := edYear2.Text;
    TagsData.Track := edTrack2.Text;
    TagsData.Url := edUrl2.Text;
    TagsData.Comments := edComment2.Text;
    TagsData.Lyrics := edLyrics2.Text;
    TagsData.CopyRight := edCopyright2.Text;

    SaveWMAFile(TagsData);
  finally
    Dispose(TagsData);
  end;
end;

Greets Chris
« Last Edit: 1 Feb '05 - 08:44 by Chris »

MrTDelphi

  • Posts: 111
Re: Editing Wma Tags
« Reply #71 on: 1 Feb '05 - 18:17 »
Thanks Chris..
everything its okeh..all files can read duration.., but
if you want to recheck n compare wt others software,
have a little mismatch about .01 to .03 second to high
like 4.10 in reading 4.13..

thanks alot
Best,
LuQ



Chris

  • Posts: 1810
Re: Editing Wma Tags
« Reply #72 on: 1 Feb '05 - 22:51 »
Hi
just change the Code in the Unit from

Code: [Select]
 
 TagsData.Duration := round ((TagsData.FileSize * 8)/ (TagsData.BitRate / 1000 ) / 1000)

too
Code: [Select]
TagsData.Duration := round ((TagsData.FileSize * 8)/ (TagsData.BitRate / 1000 + 0.5) / 1000)
Greets Chris

HarryHar

  • Posts: 147
Re: Editing Wma Tags
« Reply #73 on: 17 Feb '05 - 12:35 »
When I try to read the info from a WMA file I don't get any info. When debugging I found that AttribName is always nil!!

I can see the data which is read from the WMA tags, but for some reason the AttribName is not filled. Maybe i'm missing a DLL?

Chris

  • Posts: 1810
Re: Editing Wma Tags
« Reply #74 on: 17 Feb '05 - 13:34 »
Hi
Do you have  installed the WMA-Codec ???
if not here the Link for the  the WMA-Codec
http://www.un4seen.com/download.cgi?wmfdist.exe

If needed I can make a little Demo
btw please show us the code how you handle to get the Infos from the WMA-File
Greets Chris