11-27-2012 10:15 AM
Hi there,
I'm developing a PlayBook OS (not BB10) app using HTML5/Javascript (Sencha Touch).
Is it possible to extract the cover art picture of an mp3/aac and saved this picture on the file system ?
First I need to read and extract the mp3 bytes --> HTML5 file api 'readAsBinaryString'
Parse the bytes and find APIC tag --> ???
Create/save a picture file (.jpg or .png) from the APIC bytes --> blackberry.io.file.saveFile (path : String, data : Blob)
It's a technical challenge for me and I would like to know if it sounds possible before I spend my time on it ;o) Or maybe an other simpler way is possible ?
Thanks for your help,
Laurent
11-27-2012 11:48 AM
In theory it sounds possible.
I was parsing ID3 info from MP3's long ago with JavaScript, so I assume the same technique could be used to grab album art as well.
More info here, http://sveinbjorn.org/JavaScript_mp3_id3_data_albu
11-27-2012 12:21 PM
Oups Error 404 with your link http://sveinbjorn.org/JavaScript_mp3_id3_data_albu
ID3 infos is a bit different because it's only characters. Here with album art I think it's more difficult to retrieve the bytes, then make a blob and finally the picture file.
11-27-2012 12:24 PM
Here's an interesting approach, may be easier for you in the end.
http://stackoverflow.com/questions/11357906/album-
11-27-2012 12:27 PM
Thank you. You're probably right, the last.fm api seems easier to implement !
11-29-2012 09:29 AM
Unfortunaltly, I can't use the last.fm api because my app will be a paid one and because of the artist rights you can't use the album arts...
Well, now I'm working with discogs.
The only limitation with this api is 1000 request per day per IP and 1 request/second.