Jump to content
Sign in to follow this  

Mp3 sorter

Recommended Posts


ok its kinda basic.. and it uses the Id3 tag thing from here that i found

but i had a music folder with 3000+ random files

and i wanted them in artist folders

this script did all but 20 of them so im pretty happy.. better than doing all the 3000 XD

here it is.. maybe someone can add a gui to it and a few more features

p.s u need

http://www.dlldll.com/downdll/8538.html in the same folder as the script

and the script needs to be in the same folder as the files :)

#include <array.au3>
global $search = FileFindFirstFile("*.mp3*")
global $file = 0
global $oId3 = ObjCreate("CDDBControl.CddbID3Tag")
while 1
$filename = FileFindNextFile($search)
$fileloc = @ScriptDir & "\"
$file = $fileloc & $filename
$re = _getID3Tag($file)
$Artist = $oId3.LeadArtist
FileMove($file, @ScriptDir & "\" & $artist & "\" & $filename, 8)


Func _getID3Tag($h_file)
    If Not IsObj($oId3) Then
        Return 0
    $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  ;==>_DLLshutdown

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.