Einzelnen Beitrag anzeigen

Ghostwalker

Registriert seit: 16. Jun 2003
Ort: Schönwald
1.299 Beiträge
 
Delphi 10.3 Rio
 
#4

Re: Problem beim id3-Tag auslesen

  Alt 30. Apr 2004, 09:41
hmmm...

ok..hier mal meine Routine zum Lesen von ID3 (nur V1 !!)

Code:
procedure TID3V1.Readtag;
var
  st : TFilestream;
  buf: array[0..127] of char;
  tmppos,curpos : integer;


  function ArrayToStr(count:integer):string;
  var
    i,ende : integer;
  begin
    result := '';
    ende := curpos+(count-1);
    for I := curpos to ende do
      result := result+buf[i];
    curpos := ende+1;
  end;

begin
  readed := false;
  changed := false;
  try
    st := TFilestream.create(ffilename,fmOpenRead);
    st.Seek(-128,soFromEnd);
    st.ReadBuffer(buf[0],128);
    st.free;
    if (BUF[0]='T') and (BUF[1]='A') and (BUF[2]='G') then
    begin
      readed := true;
      curpos := 3;
      fTitle := ArrayToStr(30);
      fartist := arraytostr(30);
      falbum := arraytostr(30);
      fyear := arraytostr(4);
      tmppos := curpos+28;
      if (ord(buf[tmppos]) =$00) and (ord(buf[tmppos+1]) <> $00) then
      begin
        fversion := 1;
        fcomment := arraytostr(28);
        falbumtrack := ord(buf[curpos+1]);
        inc(curpos,2);
      end
      else
      begin
        fversion := 0;
        fcomment := trim(arraytostr(30));
      end;
      fgenre := ord(buf[127]);
    end;
  except
    on e:exception do
      raise e;
  end;
end;

Hoffe es hilft weiter
Uwe
e=mc² or energy = milk * coffee²
  Mit Zitat antworten Zitat