begin process at 2012 02 08 16:44:40
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Multimedia

 > LES MP3 ET LEURS TAGS

LES MP3 ET LEURS TAGS


 Information sur la source

Note :
5,5 / 10 - par 2 personnes
5,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Multimedia Niveau :Initié Date de création :25/11/2001 Vu :7 365

Auteur : sebrs1

Ecrire un message privé
Site perso
Ce membre participe au partage de revenus publicitaires
Commentaire sur cette source (3)
Ajouter un commentaire et/ou une note


 Description

Voici comment connaitre des infos sur le MP3.
Ce code ne marche pas tres bien (ou alors c'est a cause de windows XP, mais si ça ne vient pas de ça, cherchez une autres solution)
Il faut un OpenDialog et un bouton

Source

  • unit Unit1;
  • interface
  • uses
  • Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  • StdCtrls;
  • type
  • TID3Tag = record
  • ID:string[3];
  • Titel:string[30];
  • Artist:string[30];
  • Album:string[30];
  • Year:string[4];
  • Comment:string[30];
  • Genre:byte;
  • end;
  • TForm1 = class(TForm)
  • Button1: TButton;
  • OpenDialog1: TOpenDialog;
  • procedure Button1Click(Sender: TObject);
  • private
  • { Private-Deklarationen }
  • public
  • { Public-Deklarationen }
  • end;
  • var
  • Form1: TForm1;
  • ID3Tag:TID3Tag;
  • implementation
  • {$R *.DFM}
  • procedure Lese_ID3Tag(Filename:string);
  • var
  • Buffer:array[1..128] of char;
  • F:File;
  • begin
  • AssignFile(F, Filename);
  • Reset(F,1);
  • Seek(F,FileSize(F)-128);
  • BlockRead(F, Buffer, SizeOf(Buffer));
  • CloseFile(F);
  • with ID3Tag do begin
  • ID:=copy(Buffer,1,3);
  • Titel:=copy(Buffer,4,30);
  • Artist:=copy(Buffer,34,30);
  • Album:=copy(Buffer,64,30);
  • Year:=copy(Buffer,94,4);
  • Comment:=copy(Buffer,98,30);
  • Genre:=ord(Buffer[128]);
  • end;
  • end;
  • procedure TForm1.Button1Click(Sender: TObject);
  • begin
  • if Opendialog1.Execute then
  • begin
  • Lese_ID3Tag(opendialog1.filename);
  • showmessage(id3tag.ID);
  • showmessage(id3tag.Titel);
  • showmessage(id3tag.Artist);
  • showmessage(id3tag.Album);
  • showmessage(id3tag.Year);
  • showmessage(id3tag.Comment);
  • showmessage(id3tag.Genre);
  • end;
  • end;
  • end.
unit Unit1;
 
interface
 
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
 
type
TID3Tag = record
ID:string[3];
Titel:string[30];
Artist:string[30];
Album:string[30];
Year:string[4];
Comment:string[30];
Genre:byte;
end;
 
TForm1 = class(TForm)
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
 
var
Form1: TForm1;
ID3Tag:TID3Tag;
 
implementation
 
{$R *.DFM}
 
procedure Lese_ID3Tag(Filename:string);
var
  Buffer:array[1..128] of char;
 F:File;


begin
  AssignFile(F, Filename);
  Reset(F,1);
  Seek(F,FileSize(F)-128);
  BlockRead(F, Buffer, SizeOf(Buffer));
  CloseFile(F);
  with ID3Tag do begin
    ID:=copy(Buffer,1,3);
    Titel:=copy(Buffer,4,30);
    Artist:=copy(Buffer,34,30);
    Album:=copy(Buffer,64,30);
    Year:=copy(Buffer,94,4);
    Comment:=copy(Buffer,98,30);
    Genre:=ord(Buffer[128]);
  end;
end;
 
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  if Opendialog1.Execute then
  begin
     Lese_ID3Tag(opendialog1.filename);
    showmessage(id3tag.ID);
    showmessage(id3tag.Titel);
    showmessage(id3tag.Artist);
    showmessage(id3tag.Album);
    showmessage(id3tag.Year);
    showmessage(id3tag.Comment);
    showmessage(id3tag.Genre);
  end;
end;
 
end.

 

 Conclusion

Bon ce code n'est pas de moi mais je le cherchais alors je le met ici.

PUB :
delphiprog.fr.st


 Sources du même auteur

Source avec Zip GENERATION PAYSAGE + NAVIGATION 3D (FAUSSE 3D MALHEUREUSEMEN...
ICONE DANS LA BARRE DES TACHES
CRYPTAGE ET DÉCRYPTAGE D'UNE CHAINE
Source avec Zip HORLOGE À AIGUILLE

 Sources de la même categorie

Source avec Zip LECTURE DU FORMAT EXIF par piette
Source avec Zip Source avec une capture SYNTHÉTISEUR [BASS] par Nicolas___
Source avec Zip Source avec une capture CLAVIER ARRANGEUR MIDI VIRTUEL par etirex
Source avec Zip Source avec une capture KINECT TEST V2 JOUER DE LA MUSIC AVEC KINECT par FFCAST
Source avec Zip CLASSEMENT DES MP3 par piette

Commentaires et avis

Commentaire de damanix le 11/09/2002 22:26:42

const
Genres : array[0..146] of string =
    ('Blues','Classic Rock','Country','Dance','Disco','Funk','Grunge',
    'Hip- Hop','Jazz','Metal','New Age','Oldies','Other','Pop','R&B',
    'Rap','Reggae','Rock','Techno','Industrial','Alternative','Ska',
    'Death Metal','Pranks','Soundtrack','Euro-Techno','Ambient',
    'Trip-Hop','Vocal','Jazz+Funk','Fusion','Trance','Classical',
    'Instrumental','Acid','House','Game','Sound Clip','Gospel','Noise',
    'Alternative Rock','Bass','Punk','Space','Meditative','Instrumental Pop',
    'Instrumental Rock','Ethnic','Gothic','Darkwave','Techno-Industrial','Electronic',
    'Pop-Folk','Eurodance','Dream','Southern Rock','Comedy','Cult','Gangsta',
    'Top 40','Christian Rap','Pop/Funk','Jungle','Native US','Cabaret','New Wave',
    'Psychadelic','Rave','Showtunes','Trailer','Lo-Fi','Tribal','Acid Punk',
    'Acid Jazz','Polka','Retro','Musical','Rock & Roll','Hard Rock','Folk',
    'Folk-Rock','National Folk','Swing','Fast Fusion','Bebob','Latin','Revival',
    'Celtic','Bluegrass','Avantgarde','Gothic Rock','Progressive Rock',
    'Psychedelic Rock','Symphonic Rock','Slow Rock','Big Band','Chorus',
    'Easy Listening','Acoustic','Humour','Speech','Chanson','Opera',
    'Chamber Music','Sonata','Symphony','Booty Bass','Primus','Porn Groove',
    'Satire','Slow Jam','Club','Tango','Samba','Folklore','Ballad',
    'Power Ballad','Rhytmic Soul','Freestyle','Duet','Punk Rock','Drum Solo',
    'Acapella','Euro-House','Dance Hall','Goa','Drum & Bass','Club-House',
    'Hardcore','Terror','Indie','BritPop','Negerpunk','Polsk Punk','Beat',
    'Christian Gangsta','Heavy Metal','Black Metal','Crossover','Contemporary C',
    'Christian Rock','Merengue','Salsa','Thrash Metal','Anime','JPop','SynthPop');

- il manquait ça par rapport à l'original je crois...

Commentaire de grandvizir le 03/11/2004 10:52:16

Bizarre, selon mp3DirectCut et un éditeur hexadécimal, j'avais dans l'ordre l'ID3 suivant:

TMP3Tag = record
Title, Artist, Album : string[30];
Year : string[4];
Infos : string[30];
Track, Style : char;
end;

Il manque donc le Track (n° de piste). Sinon, les tags de mp3DirectCut sont bien détectés. Mais ceci ne détecte pas toutes les infos !!! Ca dépend du type de tag.

[damanix]
Pertinente remarque

[Zangdar]
Il faut écrire: ShowMessage(IntToStr(id3tag.Genre));

Commentaire de devilssss le 19/08/2007 22:40:39

avec le tableau de const
ca marche
showmessage(Genres[id3tag.Genre]);

mais es ce que c'est une liste officiel?
par ce que sur un morceau rock il m'affiche comedy

 Ajouter un commentaire




Nos sponsors


Appels d'offres

Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 2,668 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales