AutoHotkey Community

It is currently May 27th, 2012, 4:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: February 26th, 2010, 8:01 am 
Offline

Joined: February 20th, 2009, 9:32 pm
Posts: 48
Greetings!

So I'm just tinkering around, and I'm fiddling with a type of music library analyzer, and I'd love to include the album art for albums in the Listview row for that album. I already know how to add images to a Listview, and how to adjust the row size (though I haven't tried the bigger row size extensively yet).

So now, all I need is how to either (A) Read the embedded album art into memory, or (B) Save the art to a file.

I've searched the forum and can't find a surefire way to do it. I've seen tag reading and tag editing, but not art. I realize that AAC is probably a bit more tricky, so even MP3 would be grand.

-Pie

PS - Might be a stupid question, but what type of file would it be? Isn't it an embedded jpg?

PSS - If there's no real way to do this in AHK, I'd love suggestions for small programs that could accept MP3 files as arguments.


Last edited by notbryant on April 2nd, 2010, 9:22 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 4:06 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Hi,

I had asked a similar question and it got solved with AudioGenie. Please see post http://www.autohotkey.com/forum/viewtopic.php?t=38346

I'll post a AudioGenie wrapper soon. Than tag reading and writting including album art will be easy.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 9:17 pm 
Offline

Joined: February 20th, 2009, 9:32 pm
Posts: 48
Thanks, I have no idea how I missed that.

I can't find where AudioGenie supports cover art, but I think I'm going to try MediaInfo instead, since I'm only going to be reading, and MediaInfo isn't nagware.

I can't seem to a valid jpg image though. I've got my test MP3, and I run "mediainfo song.mp3", and it says that 'Yes', it has album art, and it's an 'image/jpeg'.

I'm really a novice when it comes to ANSI/Unicode, tags, DLLs, and all this, but I think I might be on the right track. Here's my code so far:

Code:
PathToMediaInfoDLL := "C:\Bry\MediaInfo\MediaInfo.dll"
PathToMp3File := "C:\Bry\MediaInfo\Song.mp3"

hModule := DllCall("LoadLibrary", "str", PathToMediaInfoDLL)
handle := dllcall("mediainfo\MediaInfo_New")

GetUnicodeString(PathToMp3FileUni,PathToMp3File)
dllcall("mediainfo\MediaInfo_Open", "UInt", handle, "str", PathTomp3FileUni)

Info_GetPtr:=DllCall("mediainfo\MediaInfoA_Get", "UInt", handle, "int", 0, "int", 0, "str", "Cover_Data", "int", 1, "int", 0)
Info_Get := ExtractData(Info_GetPtr)

FileAppend, %Info_Get%,Test.jpeg


It seems to run without a problem, but the JPG can't be opened. Am I just missing something blatantly obvious here?

EDIT: Durr, I feel dumb. The image is stored in Base64. I got a Base64 Decoder here, decoded the file, and it's now a perfect JPEG cover art. I would love to use a Decoder in AHK, but I tried using one that I found on the forum by Laszlo, and it took like literally 5 minutes to process the entire file. So I think that might be it.

Well, problem solved, I guess. The only annoying thing is that it takes a few seconds to extract the Cover_data, and since I kind of plan on doing it for dozens or hundreds of albums, I might have to rethink my plan.

-Pie


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Mickers, rbrtryn and 68 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group