Re: How to release an opened file?

From: Marcio Ehrlich (nouser_at_nouser.com)
Date: 01/13/04


Date: Tue, 13 Jan 2004 14:33:12 -0200


"Marcio Ehrlich" <nouser@nouser.com> wrote: in message
news:400402e3@newsgroups.borland.com...
> I am trying to adapt the project published in
> http://delphi.about.com/library/weekly/aa112800a.htm to read and write ID3
> tags of MP3 files.

Maybe this must be of interest to people who wants to use the code quoted
above.
Since that is only a tutorial (very interesting anyway), Zarko Gajic
probably didn't worry about some bugs in the code.
I found the problem. After reading the file, the program loads an
TMediaPlayer component with the filename and open it so the user can listen
to the mp3.
So, if the user clicks again on the mp3 file name, the ID3 read routine is
unable to acomplish its tasks since the file is being used by the
TMediaPlayer.
Closing the TMediaPlayer before trying to assing the mp3 file to a
TFileStream or else will solve the problem.
After the reading a/o writing, it is just a matter of openning the player
again.
BTW, the real ID3 tag has this configuration, not the one defined at the
code:

  TID3Rec = packed record
    Tag : array[0..2] of Char;
    Title,
    Artist,
    Album : array[0..29] of Char;
    Year : array[0..3] of Char;
    Comment : array[0..29] of Char;
    Genre : Byte;
  end;

Marcio



Relevant Pages

  • Re: Changing Multiple File/Folder Names
    ... You may want to check this utility out which renames the files from the tags ... Singapore Computer Service ... Can I change the MP3 File names to this format: ... I'd like to do the same to a number fo folder titles at once. ...
    (microsoft.public.windowsxp.customize)
  • Set id3 tags from mp3 files
    ... Set id3 = CreateObject ... Is there a different way of writing the id3 tags in an mp3 file, ... I would like to modify the sheet and feed a new script in order to commit the changes. ...
    (microsoft.public.scripting.vbscript)
  • Re: Set id3 tags from mp3 files
    ... Set id3 = CreateObject ... Is there a different way of writing the id3 tags in an mp3 file, ... I would like to modify the sheet and feed a new script in order to commit the changes. ...
    (microsoft.public.scripting.vbscript)
  • RE: WMP 10 MP3 Synchronized Lyrics
    ... > - Whenever lyrics are added, also empty WOAF, WOAR and WOAS tags are ... > added to an MP3 file. ... How can this padding be avoided ...
    (microsoft.public.windowsmedia.player)