AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wrapper for AudioGenie3.dll (Beta 2.0.0.2)

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
toralf



Joined: 31 Jan 2005
Posts: 3910
Location: Bremen, Germany

PostPosted: Mon Mar 08, 2010 5:04 pm    Post subject: Wrapper for AudioGenie3.dll (Beta 2.0.0.2) Reply with quote

This is a wrapper for AudioGenie3.dll (Beta 2.0.0.2) by Stefan Töngi (www.audiogenie.de). See this AHK forum post for more details on AudioGenie.

You need the AudioGenie3.dll (Beta 2.0.0.2) => http://www.audiogenie.de/en/download.htm

and this code => http://www.autohotkey.net/~toralf/AG3/AG3.ahk

All functions start with "AG3", except three functions which are general:
Code:
ATOU( ByRef Unicode, Ansi ) ; converts Ansi to Unicode (by SKAN)
UTOA( pUnicode )            ; converts Unicode to Ansi (by SKAN)
AscToHex(S){                ; converts ASCII to Hex (by Laszlo)


This is a Demo script. Place some mp3 files in the same directory or specify a path to some mp3 files
Code:
#NoEnv
#SingleInstance Force
SetBatchLines, -1
OnExit, Exit

;specify all ID3 text or URL frameIDs you are interested in (APIC will be added at the end automatically)
ListOfFrames = TALB,TIT1,TIT2,TIT3,TPE1,TPE2,TPE3,TPE4,TPOS,TRCK,TYER,COMM
Language = Eng                ;set language (DEU or ENG)
; FilePath := "X:\Artist A-Z\0-9\"   ;specify path to some mp3 files

#Include AG3.ahk          ;include AudioGenie3 wrapper
AG3_Init()                ;start AudioGenie3 und GDI+
AG3_LogFile("AG3.log")    ;set log file

;get list of files and add it to listbox
Loop, %FilePath%*.mp3               
  ListFileNames .= A_LoopFileName . "|"
Gui, 1:Add, ListBox, w200 r32 vLsbFileName gLsbFileName , %ListFileNames%

;create for each frameID a text field with description in specified language
;Plus a text field for the picture type
Loop, Parse, ListOfFrames, `,     
  {
    Option := A_Index = 1 ? "ym" : ""
    Gui, 1:Add, Text, %Option% vTxtFrame%A_LoopField%, % AG3_FrameIDName(A_LoopField, Language)
  }
Gui, 1:Add, Text, vTxtFrameAPIC, % AG3_PictureTypeName(3, Language)

;create for each frameID an ReadOnly edit control on GUI for the content of the FrameID
;Plus a picture control for the first picture
Loop, Parse, ListOfFrames, `,
  {
    Option := A_Index = 1 ? "ym" : ""
    Gui, 1:Add, Edit, %Option% w200 r1 vEdtFrame%A_LoopField% ReadOnly ,
  }
SS_BITMAP = 0xE
Gui, 1:Add, Picture, w100 h100 %SS_BITMAP% vPctAPIC HwndhPctAPIC,

Gui, 1:Show, AutoSize Restore, AudioGenie3 Wrapper Demo         ;show GUI
Return

;user selected a file in listbox
LsbFileName:
  Gui, 1:Submit,NoHide             ;get file name
  AG3_Open(FilePath LsbFileName)   ;open it with AudioGenie3
 
  Loop, Parse, ListOfFrames, `,    ;get content of all FrameIDs
    GuiControl, 1:, EdtFrame%A_LoopField%, % AG3_ID3TFrame(A_LoopField)
  If AG3_GetID3PictureCount(){     ;check if picture available
    AG3_ShowID3Picture(hPctAPIC, 1)   ;show picture and adjust picture type name
    GuiControl, 1:, TxtFrameAPIC, % AG3_PictureTypeName(AG3_GetID3PictureType(1), Language)
  }Else{
    AG3_ShowID3Picture(hPctAPIC)      ;remove any shown picture from control
    GuiControl, 1:Move, PctAPIC, W100 H100   ;resize control
    GuiControl, 1:, TxtFrameAPIC, % AG3_PictureTypeName(3, Language)  ;reset text info
  }
Return

Esc::
GuiClose:
Exit:
  AG3_Stop()    ;stop AudiGenie3 und GDI+
  ExitApp
Return


Screenshot of demo script

_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
beppo
Guest





PostPosted: Tue Mar 09, 2010 5:41 pm    Post subject: wrapper Reply with quote

Thank you for this wrapper,
that´s exactly what I needed Very Happy
Back to top
Opie



Joined: 02 Nov 2009
Posts: 101

PostPosted: Sat Apr 17, 2010 9:52 pm    Post subject: Reply with quote

thanks for the effort you put into this -- good stuff!!
Back to top
View user's profile Send private message
bpmb



Joined: 13 Sep 2009
Posts: 30

PostPosted: Sat Apr 24, 2010 12:38 pm    Post subject: Reply with quote

Toralf, great work! This one doesn't work for me though.. It lists the MP3's but when I select one the ID3 tags aren't filled in on the left side?

Not really an issue as I was only interested in getting the Album and Artist values of the files so I can create some sort of ' auto sort mp3's according to Album and Artist ' but I don't see how I can get that information..

I saw a mention of AG3_Album([String]) but I don't know how to use it?

What I want to do is create a folder for the artist if it doesn't exist, create an album folder inside that if it doesn't exist and then copy over all the relevant files for that album.. Of course you don't need to help me with that but if you could give me some pointers as to how I can get the Artist and Album info that'be great!
Back to top
View user's profile Send private message
natasc
Guest





PostPosted: Tue Jun 08, 2010 9:49 pm    Post subject: Reply with quote

is there a simple example
to select a mp3 file and audiogenie wright the duration in a text file?
Back to top
Gast (w/ nick)



Joined: 28 Nov 2005
Posts: 83

PostPosted: Tue Sep 13, 2011 7:42 am    Post subject: Reply with quote

Warning for users of window7

This wrapper requires the 32bit version of AHK.

If you run the Unicode version (which you can check with the command MsgBox % A_IsUnicode ? "Unicode" : "ANSI") then you need to download AHK_Basic.
Back to top
View user's profile Send private message
MiamiGuy



Joined: 03 Nov 2006
Posts: 61
Location: Miami

PostPosted: Fri Nov 25, 2011 7:28 am    Post subject: Reply with quote

Hi everyone...
I've been trying for days to locate through Google the version of AudioGenie3.dll (v2.0.0.2) which seems to be the only one that has wrappers and examples created for it, but I cant seem to find it. The link provided does not work. I'm particularly interested because of the cover art that can be displayed for mp3's. I found AudioGenie3 but since it seems to be a different built it doesn't seem to work. Would anyone happen to have a copy of the 2.0.0.2 version mentioned, so as to try it out???
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Gast (w/ nick)



Joined: 28 Nov 2005
Posts: 83

PostPosted: Fri Nov 25, 2011 12:25 pm    Post subject: Reply with quote

Send me a private message with your email address if you still need it.

However the current version of the AudioGenie3 should work fine as long as you:
- use the 32bit version of AHK
- make sure the dll is named the same way as in the script example
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group