Xenobiologist Posted September 27, 2007 Share Posted September 27, 2007 (edited) Hi,I wrote some small funcs to get it done. (getID3Tag and setID3Tag)You need this dll --> cddbcontrol.dll You can download from --> Download linkexpandcollapse popup#include <array.au3> Global $file = "C:\Downloads\Musik\Chris De Burg - Lady in Red.mp3" _DLLstartup() Global $re = _getID3Tag($file) If @error Then MsgBox(0, 'Error', 'Error - no array returned', 5) _ArrayDisplay($re) _setID3Tag($file, 'TrackPosition', 100) If @error Then MsgBox(0, 'Error', 'Error - setID3Tag', 5) _setID3Tag($file, 'TitleAlbum', 'Mega') If @error Then MsgBox(0, 'Error', 'Error - setID3Tag', 5) $re = _getID3Tag($file) If @error Then MsgBox(0, 'Error', 'Error - no array returned', 5) _ArrayDisplay($re) _DLLshutdown() ;=================================================================================================== ============ ; 'TitleAlbum', 'Movie', 'Title', 'CopyrightYear', 'CopyrightHolder', 'Comments', 'Label', 'BeatsPerMinute', ; 'LeadArtist', 'PartOfSet', 'TrackPosition', 'Year', 'Genre', 'FileId', 'ISRC' ;=================================================================================================== ============= Func _setID3Tag($h_file, $detail, $value) Local $oId3 = ObjCreate("CDDBControl.CddbID3Tag") If Not IsObj($oId3) Then SetError(1) Return 0 EndIf ; False means open for read-write $oId3.LoadFromFile ($h_file, False) Switch $detail Case 'TitleAlbum' $oId3.Album = $value Case 'LeadArtist' $oId3.LeadArtist = $value Case 'Title' $oId3.Title = $value Case 'TrackPosition' $oId3.TrackPosition = $value Case 'Year' $oId3.Year = $value Case 'Genre' $oId3.Genre = $value Case 'Comments' $oId3.Comments = $value Case 'Label' $oId3.Label = $value Case 'FileID' $oId3.FileId = $value Case 'IRSC' $oId3.ISRC = $value Case 'CopyrightHolder' $oId3.CopyrightHolder = $value Case 'CopyrightYear' $oId3.CopyrightYear = $value Case 'PartOfSet' $oId3.PartOfSet = $value Case 'Movie' $oId3.Movie = $value Case 'BeatsPerMinute' $oId3.BeatsPerMinute = $value Case Else SetError(2) Return 0 EndSwitch $oId3.SaveToFile ($h_file) Return 1 EndFunc ;==>_setID3Tag Func _getID3Tag($h_file) Local $oId3 = ObjCreate("CDDBControl.CddbID3Tag") If Not IsObj($oId3) Then SetError(1) Return 0 EndIf $oId3.LoadFromFile ($h_file, False) Local $idTag_A[15][2] $idTag_A[0][0] = 'Title' $idTag_A[0][1] = $oId3.Title $idTag_A[1][0] = 'LeadArtist' $idTag_A[1][1] = $oId3.LeadArtist $idTag_A[2][0] = 'Album' $idTag_A[2][1] = $oId3.Album $idTag_A[3][0] = 'TrackPosition' $idTag_A[3][1] = $oId3.TrackPosition $idTag_A[4][0] = 'Year' $idTag_A[4][1] = $oId3.Year $idTag_A[5][0] = 'Genre' $idTag_A[5][1] = $oId3.Genre $idTag_A[6][0] = 'Comments' $idTag_A[6][1] = $oId3.Comments $idTag_A[7][0] = 'Label' $idTag_A[7][1] = $oId3.Label $idTag_A[8][0] = 'FileId' $idTag_A[8][1] = $oId3.FileId $idTag_A[9][0] = 'ISRC' $idTag_A[9][1] = $oId3.ISRC $idTag_A[10][0] = 'CopyrightHolder' $idTag_A[10][1] = $oId3.CopyrightHolder $idTag_A[11][0] = 'CopyrightYear' $idTag_A[11][1] = $oId3.CopyrightYear $idTag_A[12][0] = 'PartOfSet' $idTag_A[12][1] = $oId3.PartOfSet $idTag_A[13][0] = 'Movie' $idTag_A[13][1] = $oId3.Movie $idTag_A[14][0] = 'BeatsPerMinute' $idTag_A[14][1] = $oId3.BeatsPerMinute Return $idTag_A EndFunc ;==>_getID3Tag Func _DLLstartup($DLLpath = '') If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll' RunWait('regsvr32 /s ' & '"' & $DLLpath & '"') EndFunc ;==>_DLLstartup Func _DLLshutdown($DLLpath = '') If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll' RunWait('regsvr32 /u /s ' & '"' & $DLLpath & '"') EndFunc ;==>_DLLshutdownSo long,Mega Edited October 13, 2008 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 27, 2007 Share Posted September 27, 2007 Looks good, I've been thinking of writing something to organize my music better and fix incorrect artists. thanks Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
gseller Posted September 27, 2007 Share Posted September 27, 2007 Cool, this and my example of doubleclick and rightclick in a list found in my signaturewould work groovy together... Thanks! Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 27, 2007 Author Share Posted September 27, 2007 Hi, okay so there might be some people who can use it. Nice! Feel free to improve ... So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
ptrex Posted September 28, 2007 Share Posted September 28, 2007 @Xenobiologist Good trace of the CDDBControl.dll !! Thanks ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 28, 2007 Author Share Posted September 28, 2007 HI, thanks! German forum somebody asked me whether it supports v1 or v2. So, I started to investigate , cause I didn't know the difference before. It only supports v1, I suppose. Anybody who knows a good dll, to write some udfs for id3 v2, too? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 28, 2007 Share Posted September 28, 2007 HI,thanks!German forum somebody asked me whether it supports v1 or v2. So, I started to investigate , cause I didn't know the difference before. It only supports v1, I suppose. Anybody who knows a good dll, to write some udfs for id3 v2, too?So long,MegaYou said on post #1 that it supports ID2 and ID3. is it 2 and 3 or just 1? Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 28, 2007 Author Share Posted September 28, 2007 HI, sorry. I do not know the difference. Look at the code what can be read and be written. That is all. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 28, 2007 Share Posted September 28, 2007 HI,sorry. I do not know the difference. Look at the code what can be read and be written. That is all.So long,MegaLOL, it's cool, I'm going to try to write a script with this anyways today. So I will let ya know. Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 28, 2007 Share Posted September 28, 2007 Well It seems to read ID3V1 and ID3V2 but only writes ID3V1. I could be wrong, anyone an expert on ID3??? Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
Bert Posted September 28, 2007 Share Posted September 28, 2007 I'm going to add this to audio.au3. (If that is ok with you....) The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 28, 2007 Author Share Posted September 28, 2007 I'm going to add this to audio.au3. (If that is ok with you....)Hi,if you speak to me then - of course. Feel free to do work with it. So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Delta Posted August 17, 2008 Share Posted August 17, 2008 I cant get _setID3Tag to work no error is returned either. [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 17, 2008 Author Share Posted August 17, 2008 Show your code, please. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Achilles Posted August 17, 2008 Share Posted August 17, 2008 Wow, I didn't even know this existed. I'll try to add it to my media player, it would make it more complete.. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Delta Posted August 17, 2008 Share Posted August 17, 2008 (edited) I was wrong error returned is 0 Show your code, please. Mega _DLLstartup() Local $MP3FileList = _FileListToArray("C:\Documents and Settings\Deltaforce229\My Documents\My Music\","*.mp3") GUICtrlSetData($Status, "Fixing MP3 files...") For $i = 1 to $MP3FileList[0] $PercentComplete = Round(($i / $MP3FileList[0]) * 100) $Artist = " - " & $MP3FileList[$i] $Artist = _StringBetween($Artist," - "," - ") $Title = _StringBetween($MP3FileList[$i]," - ",".mp3") _setID3Tag("C:\Documents and Settings\Deltaforce229\My Documents\My Music\" & $MP3FileList[$i],'Artist',$Artist[0]) _setID3Tag("C:\Documents and Settings\Deltaforce229\My Documents\My Music\" & $MP3FileList[$i],'Title',$Title[0]) GUICtrlSetData($ProgressBar, $PercentComplete) Next _DLLshutdown() EDIT: Never mind I figured out what I was doing wrong, I was using 'Artist' instead of 'LeadArtist'. EDIT: Ok now I'm getting this error using the code above with leadartist instead of artist. C:\Source\Autoit\ID3 Fixer\ID3 Fixer.au3 (62) : ==> The requested action with this object has failed.: $oId3.SaveToFile ($h_file) $oId3.SaveToFile ($h_file)^ ERROR Edited August 17, 2008 by Deltaforce229 [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 18, 2008 Author Share Posted August 18, 2008 Hi, I cannot reproduce your problem. Maybe you can script a little running example for testing. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Delta Posted August 19, 2008 Share Posted August 19, 2008 (edited) The script below is supposed to fix the ID3 artist and title based on the file format 'artist - title.mp3' so that the music would work with my phone. expandcollapse popup#Include <Array.au3> #include <String.au3> #Include <File.au3> #Include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> Local $ProgressGUI = GUICreate("ID3 Fixer", 501, 41, -1, -1, BitOR($WS_CAPTION,$WS_POPUP,$WS_BORDER,$WS_CLIPSIBLINGS), 0) Local $Status = GUICtrlCreateLabel("Gathering mp3 files please wait...",0, 0, 500, 20) Local $ProgressBar = GUICtrlCreateProgress(0, 20, 500, 20) GUISetState(@SW_SHOW) _DLLstartup() Local $MP3FileList = _FileListToArray("C:\Documents and Settings\Deltaforce229\My Documents\My Music\","*.mp3") GUICtrlSetData($Status, "Fixing MP3 files...") For $i = 1 to $MP3FileList[0] $PercentComplete = Round(($i / $MP3FileList[0]) * 100) $Artist = "-" & $MP3FileList[$i] $Artist = _StringBetween($Artist,"-"," - ") $Title = _StringBetween($MP3FileList[$i]," - ",".mp3") ConsoleWrite(_setID3Tag("C:\Documents and Settings\Deltaforce229\My Documents\My Music\" & $MP3FileList[$i],'LeadArtist',$Artist[0])) ConsoleWrite(_setID3Tag("C:\Documents and Settings\Deltaforce229\My Documents\My Music\" & $MP3FileList[$i],'Title',$Title[0])) ConsoleWrite(_setID3Tag("C:\Documents and Settings\Deltaforce229\My Documents\My Music\" & $MP3FileList[$i],'TitleAlbum','')) ConsoleWrite(_setID3Tag("C:\Documents and Settings\Deltaforce229\My Documents\My Music\" & $MP3FileList[$i],'Genre','')) GUICtrlSetData($ProgressBar, $PercentComplete) Next _DLLshutdown() Func _setID3Tag($h_file, $detail, $value) Local $oId3 = ObjCreate("CDDBControl.CddbID3Tag") If Not IsObj($oId3) Then SetError(1) Return 0 EndIf ; False means open for read-write $oId3.LoadFromFile ($h_file, False) Switch $detail Case 'TitleAlbum' $oId3.Album = $value Case 'LeadArtist' $oId3.LeadArtist = $value Case 'Title' $oId3.Title = $value Case 'Genre' $oId3.Genre = $value Case Else SetError(2) Return 0 EndSwitch $oId3.SaveToFile ($h_file) Return 1 EndFunc ;==>_setID3Tag Func _DLLstartup($DLLpath = '') If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll' ShellExecuteWait('regsvr32', '/s /i ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE) EndFunc ;==>_DLLstartup Func _DLLshutdown($DLLpath = '') If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll' ShellExecuteWait('regsvr32', ' /s /u ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE) EndFunc ;==>_DLLshutdown Edited August 19, 2008 by Deltaforce229 [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 20, 2008 Author Share Posted August 20, 2008 Hi, so what did you change? What was the problem? Problem in my code, or your fault? Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Spiff59 Posted August 20, 2008 Share Posted August 20, 2008 (edited) If any of you are interested in peering at some C++ code, there's a slick little MP3 tag editor/shell extension that I've found handy for years. It's called MP3ext and it handles ID3 V1 and V2, along with lots of other nifty functions (I love the icons that indicate bitrate). The program was fairly mature when the author ceased development on it a few years ago and has made it (along with the source code) avail as "giftware". Am guessing you might gleen some answers from peeking at his .cpp and .h files... Just google MP3ext and you'll find his German site. Edited August 20, 2008 by Spiff59 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now