Download:
AudioGenie2.dll ( UPX'ed to 135 KiB / Orig.sz 305 KiB ) or get it from
Official download page
View:
AudioGenie DLL Documentation
Intro:
AudioGenie is a fast 32Bit DLL with over 345 functions to read audio file information (like Bitrate, Samplerate, Frames, Duration, Version-Number, etc). The DLL also has functionality to read and write audio file tags like id3v1, id3v2, ape and more.
Quote:
http://www.audiogenie.de/en/index.htm
AudioGenie is Freeware. You can download it from the internet and use it for free. The only restriction is, that AudioGenie displays a small popup message for two seconds on project start, to signify that you are using AudioGenie.
But if you would like to disable the popup message, you can make a donation by visiting the donation link.
After that, you will be sent a Registration Key to deactivate the Popup in your Project.
You will be informed via e-mail if future updates for AudioGenie are available.
For 20 EUD you can get a commerical license and for lesser donations ( may be 5-10 ) you can get a key to suppress the nag-pop ( for personal use ) .. Fair enough?!..
The following popup is displayed for 2 seconds

(The DLL is capable of processing 2000 files in that duration )
I never thought I would recommend a nagware... but every other thing about
AudioGenie is good - the DLL size, the execution speed and especially the interface. No handles/structures/pointers to worry about. When you open an Audio file with
AUDIOAnalyzeFile() - it creates and maintains a structure internally. So all consecutive calls like GetID3V2Track(), GetID3V2Artist, GetID3V2Album() etc, do not even require a parameter - AudioGenie just returns it, much to our delight.
The only catch is that it handles strings as unicode.
Here is an example for a single file:
Code:
SetWorkingDir, %A_ScriptDir%
DllCall( "LoadLibrary", Str,"AudioGenie2.dll" )
ATC := A_TickCount
mp3FileA := "SoEmo.mp3" ; Path to MP3 file
ATOU( mp3FileU, mp3FileA ) ; Convert path to Unicode
DllCall( "AudioGenie2\AUDIOAnalyzeFile", Str,mp3FileU ) ; Load Mp3 file
MsgBox, 64, % "AudioGenie - " ( A_TickCount-ATC ) "ms"
, % "Track#:`t" UTOA( DllCall("AudioGenie2\GetID3V2Track" ) ) "`n"
. "Title:`t" UTOA( DllCall("AudioGenie2\GetID3V2Title" ) ) "`n"
. "Artist:`t" UTOA( DllCall("AudioGenie2\GetID3V2Artist") ) "`n"
. "Album:`t" UTOA( DllCall("AudioGenie2\GetID3V2Album" ) ) "`n"
. "Genre:`t" UTOA( DllCall("AudioGenie2\GetID3V2Genre" ) ) "`n"
ATOU( ByRef Unicode, Ansi ) { ; Ansi to Unicode
VarSetCapacity( Unicode, (Len:=StrLen(Ansi))*2+1, 0 )
Return DllCall( "MultiByteToWideChar", Int,0,Int,0,Str,Ansi,Int,Len, Str,Unicode, Int,Len )
}
UTOA( pUnicode ) { ; Unicode to Ansi
VarSetCapacity( Ansi,(nSz:=DllCall( "lstrlenW", UInt,pUnicode )+1) )
DllCall( "WideCharToMultiByte", Int,0, Int,0, UInt,pUnicode, Int,nSz
, Str,Ansi, Int,nSz+1, Int,0, Int,0 )
Return Ansi
}
Extended example:Code:
SetWorkingDir, %A_ScriptDir%
SetBatchLines -1
mp3Path := "E:\MP3\Tamil\"
Loop, %mp3Path%\*.mp3,0,1
mp3List .= ( mp3List<>wm_null ? "`n" : "" ) . A_LoopFileLongPath
Gui, Add, ListView, w800 r40 Grid -Theme, #|Length|Title|Artist|Album|Genre
DllCall( "LoadLibrary", Str,"AudioGenie2.dll" )
SetTimer, HideNag, -1
DllCall( "AudioGenie2\AUDIOAnalyzeFile", Str,Dummy ) ; Dummy Call for SplashText
T1 := A_TickCount
Loop, Parse, mp3List, `n
{
mp3FileA := A_LoopField
ATOU(mp3FileU,mp3FileA)
If DllCall( "AudioGenie2\AUDIOAnalyzeFile", Str,mp3FileU ) <> 1
Continue
TrkLenMs := DllCall( "AudioGenie2\AUDIOGetDurationMillis" )
TrkLen := FormatMs( TrkLenMs )
Track# := UTOA( DllCall("AudioGenie2\GetID3V2Track" ) )
Title := UTOA( DllCall("AudioGenie2\GetID3V2Title" ) )
Artist := UTOA( DllCall("AudioGenie2\GetID3V2Artist") )
Album := UTOA( DllCall("AudioGenie2\GetID3V2Album" ) )
Genre := UTOA( DllCall("AudioGenie2\GetID3V2Genre" ) )
LV_Add( "", Track#, TrkLen, Title, Artist, Album, Genre )
mp3FilesCount += 1
}
T2 := A_TickCount
LV_ModifyCol( 1, "20" ) , LV_ModifyCol( 2, "40 Center" ), LV_ModifyCol( 3, "200" )
LV_ModifyCol( 4, "200" ), LV_ModifyCol( 5, "200" ), LV_ModifyCol( 6, "120" )
Gui, Show,, % "Audio Genie - ID3v2 Demo ( " mp3FilesCount " files in " T2-T1 "ms. )"
Return
GuiClose:
ExitApp
Return
ATOU( ByRef Unicode, Ansi ) { ; Ansi to Unicode
VarSetCapacity( Unicode, (Len:=StrLen(Ansi))*2+1, 0 )
Return DllCall( "MultiByteToWideChar", Int,0,Int,0,Str,Ansi,Int,Len, Str,Unicode, Int,Len )
}
UTOA( pUnicode ) { ; Unicode to Ansi
VarSetCapacity( Ansi,(nSz:=DllCall( "lstrlenW", UInt,pUnicode )+1) )
DllCall( "WideCharToMultiByte", Int,0, Int,0, UInt,pUnicode, Int,nSz
, Str,Ansi, Int,nSz+1, Int,0, Int,0 )
Return Ansi
}
FormatMs( Ms ) {
Secs := Ms//1000, Time:=20000101
Time += %Secs%, Seconds
FormatTime, mmss, %Time%, mm:ss
Return ((hh:=Round(Secs//3600)) > 0 ? hh ":" : "" ) mmss
}
HideNag:
WinWait, ahk_class #32770, This Project uses the Freeware AudioGenie2
WinHide
Return
I am also wrapping up functions for
MediaInfo.dll which would suffice for read requirements, but for
writing tags, I would recommend this DLL. ( Disclaimer: Try enough before registering. )
Edit: couple of typos fixed