Forum » Programiranje » [Delphi] Problem pri MP3 Playerju z ID3 Tag Update-om
[Delphi] Problem pri MP3 Playerju z ID3 Tag Update-om
blackfly666b ::
Pozdrav
Takole je definiran record za ID3 tag:
--------------
type
TID3Rec = packed record
Tag : array[0..2] of Char;
Title,
Artist,
Comment,
Album : array[0..29] of Char;
Year : array[0..3] of Char;
Genre : Byte;
end;
--------------
Tole pa imam pa spreminjanje:
--------------
procedure ChangeID3Tag(NewID3: TID3Rec; mp3FileName: string; Title,Artist,Album,Year,Genre,Comment:TEdit);
var
fMP3: file of Byte;
OldID3 : TID3Rec;
begin
NewID3.Tag:='TAG';
StrPCopy( @NewID3.title[0], string( title.text) );
StrPCopy( @NewID3.artist[0], string( artist.text) );
StrPCopy( @NewID3.album[0], string( album.text) );
StrPCopy( @NewID3.comment[0], string( comment.text) );
StrPCopy( @NewID3.year[0], string( year.text) );
NewID3.Genre:=4;
try
AssignFile(fMP3, mp3FileName);
Reset(fMP3);
try
Seek(fMP3, FileSize(fMP3) - 128);
BlockRead(fMP3, OldID3, SizeOf(OldID3));
if OldID3.Tag = 'TAG' then
Seek(fMP3, FileSize(fMP3) - 128);
BlockWrite(fMP3, NewID3, SizeOf(NewID3))
except
else
Seek(fMP3, FileSize(fMP3));
BlockWrite(fMP3, NewID3, SizeOf(NewID3));
end;
finally
CloseFile(fMP3);
end;
end;
------------
Tole je pa akcija:
------------
procedure Tform1.Image5Click(Sender: TObject);
var NewID3:TID3Rec;
mp3filename:string;
begin
ChangeID3Tag(NewId3,mp3filename,edtitle,edartist,edalbum,edyear,edgenre,edcomment);
end;
------------
zadeva se mi sesuje, ko kliknem na sliko "Update" (image5)... nimam pojma zakaj, s tem se ukvarjam ze pol dneva...
Takole je definiran record za ID3 tag:
--------------
type
TID3Rec = packed record
Tag : array[0..2] of Char;
Title,
Artist,
Comment,
Album : array[0..29] of Char;
Year : array[0..3] of Char;
Genre : Byte;
end;
--------------
Tole pa imam pa spreminjanje:
--------------
procedure ChangeID3Tag(NewID3: TID3Rec; mp3FileName: string; Title,Artist,Album,Year,Genre,Comment:TEdit);
var
fMP3: file of Byte;
OldID3 : TID3Rec;
begin
NewID3.Tag:='TAG';
StrPCopy( @NewID3.title[0], string( title.text) );
StrPCopy( @NewID3.artist[0], string( artist.text) );
StrPCopy( @NewID3.album[0], string( album.text) );
StrPCopy( @NewID3.comment[0], string( comment.text) );
StrPCopy( @NewID3.year[0], string( year.text) );
NewID3.Genre:=4;
try
AssignFile(fMP3, mp3FileName);
Reset(fMP3);
try
Seek(fMP3, FileSize(fMP3) - 128);
BlockRead(fMP3, OldID3, SizeOf(OldID3));
if OldID3.Tag = 'TAG' then
Seek(fMP3, FileSize(fMP3) - 128);
BlockWrite(fMP3, NewID3, SizeOf(NewID3))
except
else
Seek(fMP3, FileSize(fMP3));
BlockWrite(fMP3, NewID3, SizeOf(NewID3));
end;
finally
CloseFile(fMP3);
end;
end;
------------
Tole je pa akcija:
------------
procedure Tform1.Image5Click(Sender: TObject);
var NewID3:TID3Rec;
mp3filename:string;
begin
ChangeID3Tag(NewId3,mp3filename,edtitle,edartist,edalbum,edyear,edgenre,edcomment);
end;
------------
zadeva se mi sesuje, ko kliknem na sliko "Update" (image5)... nimam pojma zakaj, s tem se ukvarjam ze pol dneva...
blackfly666b ::
Aja no, se to: Ce ID3 tag obstaja, mi izpise "I/O Error 6", ce pa ID3 Taga ni, se sesuje in izpise "Access ViolatioN" ...
Taras_Bulba ::
Uf mislm, da je i/o error 6 napaka pri branju datoteke in ma nekej zveze z seek(). Sem mel isti problem, ampak je že kako leto od tega... Poglej v help kaj pomen i/o error 6
iBojan ::
http://www.torry.net/apps/utilities/mme...
Tule maš en mp3 player z izvorno kodo pa lahko vse lepo vidiš kako je narejeno ;)
Tule maš en mp3 player z izvorno kodo pa lahko vse lepo vidiš kako je narejeno ;)
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | oracle 12 identity (the old way)Oddelek: Programiranje | 1056 (861) | detroit |
» | [SQL] InsertOddelek: Programiranje | 2075 (1677) | greentech |
» | Program, ki ti izpiše naslove vseh mp3 v določeni mapi ; izpisek skladbOddelek: Programska oprema | 1360 (1157) | RealSlimShady |
» | CD textOddelek: Pomoč in nasveti | 1306 (1108) | DrSergioDJ |
» | php, mysql SELECT MAX(id)...Oddelek: Programiranje | 1272 (1168) | Gre-Gor |