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

Java Development

Reply
New Contributor
Posts: 3
Registered: ‎06-24-2011
My Device: Torch 9800

Re: how to retrieve ID3 art Image from an .mp3 file

Hi,

 

Could smartsan (or someone else) please post the code you used to retrieve file properties (name, artist, genre, etc). I'm a beginner and having trouble with this. Any help appreciated.

 

Thank you in advance :smileyhappy:

 

Julia

New Contributor
Posts: 7
Registered: ‎10-05-2011
My Device: Blackberry bold 9100

Re: how to retrieve ID3 art Image from an .mp3 file

Hello,

 

I am trying to use this code to get the image from .mp3 file but the problem is my mp3 file is located at some server and the path is like "http://www.xyz.com/upload/song/123.mp3". Please guide me in solving the problem. Thanks in advance.

Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: how to retrieve ID3 art Image from an .mp3 file

After the code is a small example code where a FileConnection is opened. Replace the FileConnection code with code that connects to your remote file. If you don't know how, look at the sticky thread on network connections.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
New Contributor
Posts: 7
Registered: ‎10-05-2011
My Device: Blackberry bold 9100

Re: how to retrieve ID3 art Image from an .mp3 file

This is the code i have written to open and read remote file. The http response code is OK (200).

 

InputStream inputStream = httpConn.openInputStream();
                                byte[] responseData = new byte[10000];
                                int length = 0;
                                while (-1 != (length = inputStream.read(responseData)))
                                {
                                rawResponse.append(new String(responseData, 0, length));
                                }
                            inputStream.close(); 
                            inputStream = null; 
                            httpConn.close(); 
                            httpConn = null;

 

but it gives me "Outofmemery error". Plz help.

Visitor
Posts: 1
Registered: ‎12-05-2011
My Device: 9000

Re: how to retrieve ID3 art Image from an .mp3 file

Hi, I have a problem. I can read cover art from ID3 tag. Some of my mp3 file doesn't have cover art embbed in ID3 tag (also check using MyID3 program), but the default player of blackberry phone can read and display cover from that file. I think there's another way to store the cover art in the mp3 file but I still can't find it. Can anyone help me?


Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: how to retrieve ID3 art Image from an .mp3 file

Not that I know of. Your option is ID3 or some other proprietary format. If the MP3 doesn't have an album cover then it displays either a default cover (which we don't have access to) or it could be showing one of the "other" covers as ID3 supports album cover, back, booklet, etc. pictures as well. It is unknown if the default player will use one of those if an album cover is not found.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.