was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

41 Visitors Online


 
...Lesen von ID3V1-Tags mit Hilfe der BASS.dll?
Autor: Loïs Bégué
Homepage: http://www.arpoon.de
[ Tip ausdrucken ]  

Tip Bewertung (13):  
     


(* ------------------------------------------------------------

   This Tip doesn't allow to change the ID3-Tag but it minimize the
   overhead for reading.

   BASS.DLL is a freeware library to handle with sound devices,
   allowing playing of MP3/MOD/.../WMA files and also recording,
   streaming from the web and so on.
   See for more information : http://www.un4seen.com/

------------------------------------------------------------ *)

(* ---------- "The easy way" utility unit ---------- *)
:
unit B_ID3V1;

interface

uses
  
Windows, Messages, SysUtils, Classes;

type
  
// some standard definition
  
PID3V1Rec = ^TID3V1Rec;
  TID3V1Rec = packed record
    
Tag: array[0..2] of Char;
    Title: array[0..29] of Char;
    Artist: array[0..29] of Char;
    Album: array[0..29] of Char;
    Year: array[0..3] of Char;
    Comment: array[0..29] of Char;
    Genre: Byte;
  end;
const
  
// some standard "genre". To be completed.
  
cID3V1FGenre: array[0..147] of string = ('Blues', 'Classic Rock',
    'Country', 'Dance',..., 'Synthpop');

function BASSID3ToID3V1Rec(PC: PChar): TID3V1Rec;

implementation

function 
BASSID3ToID3V1Rec(PC: PChar): TID3V1Rec;
var
  
TempID3V1: TID3V1Rec; // only for a better checking
begin
  
// fill the record with some dummy chars
  
FillChar(Result, SizeOf(TID3V1Rec) - 1, '?');
  // check to see if ther's something to map
  
if (PC = nilthen Exit;
  // convert/copy to the record structure
  
TempID3V1 := PID3V1Rec(PC)^;
  // check to see if it's really a ID3V1 Tag
  // else just give the dummy record back
  
if SameText(TempID3V1.Tag, 'TAG') then  Result := TempID3V1;
end;

(* ---------- How to use this function ---------- *)
var
  
ID3: TID3V1Rec;
  //...
  // after the Stream was initialized,
  // f.e. with the function "BASS_StreamCreateFile(...)"
  // after the Stream was initialized,
  // f.e. with the function "BASS_StreamCreateFile(...)"
  
ID3:= BASSID3ToID3V1Rec( BASS_StreamGetTags(fStreamHandle, BASS_TAG_ID3) );
  Showmessage(
          'Title   : ' + ID3.Title
          'Artist  : ' + ID3.Artist
          'Year    : ' + ID3.Year
          'Comment : ' + ID3.Comment
          'Genre   : ' + cID3V1FGenre[ID3.Genre]
          );


 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners