Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

ID3 UDF ID3v1 & ID3v2 MP3 Tags


  • Please log in to reply
151 replies to this topic

#41 nend

nend

    Prodigy

  • Active Members
  • PipPipPip
  • 166 posts

Posted 06 February 2010 - 01:42 PM

Hello,

Is there anyone how still can work with this script?
With the coming of version 3.3.2.0 from Autoit it won't work anymore.
I've look to it but the script is to complicated for me.

Is there someone how have the answer for this?







#42 joeyb1275

joeyb1275

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 29 June 2010 - 04:55 PM

Hello,

Is there anyone how still can work with this script?
With the coming of version 3.3.2.0 from Autoit it won't work anymore.
I've look to it but the script is to complicated for me.

Is there someone how have the answer for this?


I have been away from this forum for some time now, but I think I will have time to look into this. I would also like to add some of the fixes that I read about in these postings. Thanks to all the people contributing.

#43 nend

nend

    Prodigy

  • Active Members
  • PipPipPip
  • 166 posts

Posted 30 June 2010 - 07:53 AM

I have been away from this forum for some time now, but I think I will have time to look into this. I would also like to add some of the fixes that I read about in these postings. Thanks to all the people contributing.


Yeah!!
I’ll look forward to it.

#44 joeyb1275

joeyb1275

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 10 July 2010 - 04:00 PM

Yeah!!
I’ll look forward to it.


New ID3.au3 code posted, see first posting in this thread. Thanks to michael2t for all his help!

Let me know if there are any issues.

#45 nend

nend

    Prodigy

  • Active Members
  • PipPipPip
  • 166 posts

Posted 11 July 2010 - 08:12 AM

@joeyb1275 I've tryed a few thinks and I think it al works great.
Thanks a lot!

New ID3.au3 code posted, see first posting in this thread. Thanks to michael2t for all his help!

Let me know if there are any issues.



#46 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,462 posts

Posted 13 August 2010 - 04:54 PM

@joeyb1275 - You don't appear to have discovered & fixed the issue with Genre (TCON) not returning a value.

If you change -
    Elseif $FrameID == "TCON" Then;Content Type/Genre         $bTagFieldFound = True         $bFrameData = Binary($aFrameData[2])         $Genre = BinaryToString($bFrameData)         If StringMid($Genre,1,1) == "(" Then ;check if first char is "("             $closeparindex = StringInStr($Genre,")")             $GenreID = StringMid($Genre,2,$closeparindex-1)             $Genre = _GetGenreByID($GenreID)         EndIf ;If no "(" then return the whole field as is         $sFrameString = $Genre

to
    Elseif $FrameID == "TCON" Then;Content Type/Genre         $bTagFieldFound = True         $bFrameData = Binary($aFrameData[2])     $bFrameData = BinaryMid($bFrameData,2)         $Genre = BinaryToString($bFrameData)         If StringMid($Genre,1,1) == "(" Then ;check if first char is "("             $closeparindex = StringInStr($Genre,")")             $GenreID = StringMid($Genre,2,$closeparindex-1)             $Genre = _GetGenreByID($GenreID)         EndIf ;If no "(" then return the whole field as is         $sFrameString = $Genre

in the _GetID3FrameString($sFrameData) function, that will do the trick.
You obviously missed including the line $bFrameData = BinaryMid($bFrameData,2). Without it, neither the genre number or text version get's returned.

Once again, thanks for sharing.
I use this UDF in a few of my programs now.

Apologies if this has been mentioned before, but if so it seems you've missed it (i.e. it's still missing from current ID3.au3).

Edited by TheSaint, 13 August 2010 - 04:56 PM.

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#47 gobsor

gobsor

    Seeker

  • Active Members
  • 42 posts

Posted 12 September 2010 - 04:51 PM

Hey there,

any chance to grab the playtime of the MP3 file in, lets say, seconds?

I thought "TIME" or "TLEN" does the job, but somehow it always returns an empty string ("") for me.

Any suggestions on how to read the track's length in seconds?

Regards

EDIT:
I found some cool UDF by RazerM, Melba23, some code by Simucal, PsaltyDS HERE, works on (at least all of my tested) mp3 files ;)

Cheers!

Edited by gobsor, 12 September 2010 - 05:37 PM.


#48 deeppete

deeppete

    Seeker

  • New Members
  • 1 posts

Posted 18 November 2010 - 08:41 PM

[quote name='joeyb1275' timestamp='1176162823' post='327129']
(20100710) I have updated the ID3 UDF to work in the latest Autoit (v3.3.6.1)

Can anyone help me! I'm having problems using ID3.au3 and ID3_Example_GUI.au3 programs
the problem is, is that it don't seem to read some of my mp3 files.
opon opening the result shows
Artist - ÿþA
Album - ÿþV

Please note i have not edited the ID3.au3 and ID3_Example_GUI.au3 files
Whats going on?

#49 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,462 posts

Posted 20 November 2010 - 03:02 AM

Can anyone help me! I'm having problems using ID3.au3 and ID3_Example_GUI.au3 programs
the problem is, is that it don't seem to read some of my mp3 files.
opon opening the result shows
Artist - ÿþA
Album - ÿþV

Please note i have not edited the ID3.au3 and ID3_Example_GUI.au3 files
Whats going on?


I believe that is something to do with Unicode text, but I may be wrong?
A quick work-a-round is to use values from File Properties instead, and then rewrite the values.
Do a search in the Forum for the relevant code (or UDF?).

Or use a program like Tagscanner to do it (but be aware, that it defaults to Unicode I think, so you'll need to change that setting).

Hopefully someone will implement a fix for it here before too long.

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#50 joeyb1275

joeyb1275

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 10 March 2011 - 01:02 PM

I believe that is something to do with Unicode text, but I may be wrong?
A quick work-a-round is to use values from File Properties instead, and then rewrite the values.
Do a search in the Forum for the relevant code (or UDF?).

Or use a program like Tagscanner to do it (but be aware, that it defaults to Unicode I think, so you'll need to change that setting).

Hopefully someone will implement a fix for it here before too long.


Checkout the updates as of 20110310 (see first post) to see if this problem is corrected.

#51 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,462 posts

Posted 11 March 2011 - 02:32 AM

Thanks for that, will check it out.

As well as the issue I mention at post #46, I've discovered and quick fixed a few others, including issues with parts of ID3 v1.
I don't know whether you've corrected any of these, but I can pass on to you what I have done so far if you like?

Edited by TheSaint, 11 March 2011 - 02:33 AM.

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#52 joeyb1275

joeyb1275

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 11 March 2011 - 11:21 AM

Thanks for that, will check it out.

As well as the issue I mention at post #46, I've discovered and quick fixed a few others, including issues with parts of ID3 v1.
I don't know whether you've corrected any of these, but I can pass on to you what I have done so far if you like?


Thanks for checking it out! I think I have that fix in there that you mention in post #46, but let me know if it works for you. If there is anything else that you found I would love to know about it. Thanks!

#53 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,462 posts

Posted 11 March 2011 - 04:44 PM

No worries, will do.

I've attached my latest version of your UDF, which has some corrections commented by me. For any others I may have missed, you'll have to do a file text comparison.
Obviously your most recent changes have not been incorporated yet.
You no doubt understand this stuff better than me, so you may want to modify my quick corrections somewhat.

Attached File  ID3.au3   50.96KB   405 downloads

Thanks again!

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#54 joeyb1275

joeyb1275

    Wayfarer

  • Active Members
  • Pip
  • 61 posts

Posted 11 March 2011 - 11:06 PM

No worries, will do.

I've attached my latest version of your UDF, which has some corrections commented by me. For any others I may have missed, you'll have to do a file text comparison.
Obviously your most recent changes have not been incorporated yet.
You no doubt understand this stuff better than me, so you may want to modify my quick corrections somewhat.

Attached File  ID3.au3   50.96KB   405 downloads

Thanks again!

This is great feedback! Thanks!
I want to look at some of the changes you put in there further, but I saw you added a conditional on line 758
; Memory fix by TheSaint (just to avoid crashing)(not a true fix) If $FrameSize > 100000 Then     $FrameSize = 100000     $bad = 1     ;MsgBox(262192, "$FrameSize", $FrameSize) EndIf


Did you have problems with the $FrameSize being too big and crashing the program?

Edited by joeyb1275, 11 March 2011 - 11:07 PM.


#55 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,462 posts

Posted 12 March 2011 - 10:28 AM

This is great feedback! Thanks!
I want to look at some of the changes you put in there further, but I saw you added a conditional on line 758

; Memory fix by TheSaint (just to avoid crashing)(not a true fix) If $FrameSize > 100000 Then     $FrameSize = 100000     $bad = 1     ;MsgBox(262192, "$FrameSize", $FrameSize) EndIf


Did you have problems with the $FrameSize being too big and crashing the program?

A pleasure to help.

I don't recall the exact specifics now, but obviously this allowed me to quickly fix an issue where a crash happened (making my program exit) ... probably due to an illegal, oversize or corrupt ID3 tag entry, which can no longer occur now that I've updated the tag.

Edited by TheSaint, 12 March 2011 - 10:29 AM.

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#56 flashlab

flashlab

    Seeker

  • Active Members
  • 29 posts

Posted 26 March 2011 - 02:43 PM

I make a simple func to read SYLT. Enjoy~
AutoIt         
Func _GetSynLyrics($hFile,$FrameLen)     Local $LengthToRead = $FrameLen, $_head, $LyricsFilename = @ScriptDir & "\" & "SynLyrics.txt", $bReturn     $ID3Filenames &= $LyricsFilename & "|"     $s_head = FileRead($hFile,6)     $s_Encoding = BinaryMid($s_head,1,1)     $s_Language = BinaryMid($s_head,2,3)     $s_Stamp = BinaryMid($s_head,5,1)     $s_Type = BinaryMid($s_head,6,1)     $LengthToRead -= 6     $s_Descriptor = ''     $Byte = FileRead($hFile,1)     $sb_Descriptor = $Byte     $LengthToRead -= 1     While $Byte <> "0x00"         $s_Descriptor &= BinaryToString($Byte)         $Byte = FileRead($hFile,1)         $sb_Descriptor &= $Byte         $LengthToRead -= 1     WEnd     $bLyrics_Bin = FileRead($hFile,$LengthToRead)     $SynText=Binary('')     $i=1 ;~  Do   ;~      $i+=1 ;~      $nByte=BinaryMid($bLyrics_Bin,$i,1) ;~  Until $nByte <> "0x00"      While $i<$LengthToRead         $SynBin=Binary('')         While 1             $nByte=BinaryMid($bLyrics_Bin,$i,1)             $i+=1             If $nByte="0x00" Then ExitLoop             $SynBin &= $nByte         WEnd         $SynText&=StringToBinary(Dec(Hex(BinaryMid($bLyrics_Bin,$i,4))),1)         $SynText&=BinaryMid(0x7C7C,1,2)         $SynText&=$SynBin         $SynText&=BinaryMid(0x0A0D,1,2)         $i+=4     WEnd     $hLyricFile = FileOpen($LyricsFilename, 2) ;Open for write and erase existing     FileWrite($hLyricFile,$SynText)     FileClose($hLyricFile) ;~     Switch $bText_Encoding ;~      Case 0x00 ;~          $Lyrics_Text = BinaryToString($bLyrics_Text) ;~      Case 0x01 ;~          $Lyrics_Text = BinaryToString($bLyrics_Text,2) ;~  EndSwitch     $bReturn = $s_Encoding & $s_Language & $SynText     $bReturn &= "|" & $LyricsFilename     Return $bReturn EndFunc

call the func in _ReadID3v2
                        Switch $FrameID                         Case "APIC" ;Picture (Write to File)                             $FrameData = _GetAlbumArt($hFile,$FrameSize)                         Case "USLT" ;Lyrics (Write to File)                             $FrameData = _GetSongLyrics($hFile,$FrameSize)                         Case "SYLT"                             $FrameData = _GetSynLyrics($hFile,$FrameSize)                         Case Else                             $FrameData = FileRead($hFile,$FrameSize)                     EndSwitch


#57 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,037 posts

Posted 14 April 2011 - 06:20 PM

This isn't working for me, Windows 7 Professional x86, administrator account. Sometimes it works fine and will change the tags when I write them, but most of the time it is blanking out the tags and making the file unplayable in any media player including VLC. I don't get any errors I just get a file with the tags removed and in one case it left the V2 song title and changed the artist name to the album title.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to an XP machine, and I'm not going to.

 

Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude

 

How to ask questions the smart way!

 

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.
Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.


#58 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,573 posts

Posted 14 April 2011 - 06:28 PM

This isn't working for me, Windows 7 Professional x86, administrator account. Sometimes it works fine and will change the tags when I write them, but most of the time it is blanking out the tags and making the file unplayable in any media player including VLC. I don't get any errors I just get a file with the tags removed and in one case it left the V2 song title and changed the artist name to the album title.

I get all kinds of garbage happening with this UDF so don't feel alone. It often tells me I need a different version. That's wrong, I just need a UDF that works. Idoesn't work on any Windows version I've tried it on but most problems are in Vista and Win 7, both 32 bit.
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"

#59 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,462 posts

Posted 15 April 2011 - 02:22 PM

I've run into issues in the past, where APE tags seem to be a possible culprit and stop updates happening.
Heaven's knows why APE tags need to be inserted into MP3 files?
I use foobar2000 (also see it's utilities right-click option), MP3Tag and/or Tagscanner to fix issues that arise, plus MP3Val to do a final validation.

Most of the time (i.e. with my own LAME ripped tracks) I don't have issues with the UDF.
Various downloads sometimes have header issues or junk in the files, etc.

EDIT
That's with WinXP though.

Edited by TheSaint, 15 April 2011 - 02:23 PM.

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#60 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 5,462 posts

Posted 17 April 2011 - 05:11 PM

@joeyb1275 - just a quick mention in passing, as I haven't yet had a chance to check it out properly, but a bunch of MP3's in a folder I was checking out, kept causing my program to crash when parsing the tags. One thing I noticed about all the Track Title tags, were that they all started with a time and then text (i.e. 12:30 Last Train). I'm guessing at this point, that the illegal filename character of ':' is at fault somehow. If I remember correctly, it was a Roger Waters album ... not that that is important I suppose.

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users