Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 276
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom

Tell me if it's possible

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

Twitter : @LaurentKP
My apps
BlackBerry Development Advisor
Posts: 769
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: Tell me if it's possible

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_album_artwork

 

Developer
Posts: 276
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom

Re: Tell me if it's possible

Oups Error 404 with your link http://sveinbjorn.org/JavaScript_mp3_id3_data_album_artwork

 

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. 

 

 

Twitter : @LaurentKP
My apps
BlackBerry Development Advisor
Posts: 769
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: Tell me if it's possible

Here's an interesting approach, may be easier for you in the end.

 

http://stackoverflow.com/questions/11357906/album-art-work-api

 

Developer
Posts: 276
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom

Re: Tell me if it's possible

Thank you. You're probably right, the last.fm api seems easier to implement !

Twitter : @LaurentKP
My apps
Developer
Posts: 276
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom

Re: Tell me if it's possible

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.

Twitter : @LaurentKP
My apps