views:

60

answers:

1

HI I am new to Blackberry. I am developing an application to get the song name from the live audio stream. I am able to get the mp3 stream bytes from the particular radioserver.To get the song name I add the flag "Icy-metadata:1".So I am getting the header from the stream.To get the mp3 block size I use "Icy-metaInt".How to recognize the metadatablocks with this mp3 block size.I am using the following code.can anyone help me to get it...Here the b[off+k] is the bytes that are from the server...I am converting whole stream in to charArray which is wrong, but how to recognize the metadataHeaders according to the mp3 block size..

b[off+k] = buffers[PlayBuf]PlayByte];

String metaSt = httpConn.getHeaderField("icy-metaint");

metaInt=Integer.parseInt(metaSt);

               for (int i=0;i<b[off+k];i++)
             {

            metadataHeader+=(new String(b)).toCharArray();
                System.out.println(metadataHeader);
            metadataLength--;
+1  A: 

Blackberry has no native regex functionality; I would recommend grabbing the regexp-me library (http://code.google.com/p/regexp-me/) and compiling it into your code. I've used it before and its regex support is pretty good. I think the regex in the code you posted would work just fine.

Marc Paradise
Hi Marc thanks for suggestion...I import the above mentioned package to my project and check but it is not supports to the Blackberry environment and complaining errors.What to do..Is there any other way to convert the byte stream in to string and found the metadata blocks..Please refer any reference or any sample code snippet.Thanks you very much Marc!!
Koushik
As I recall I did have to make a couple of minor tweaks to get it to build. If you want, you can grab the modified source from my project: http://svn.bbssh.org/trunk/BBSSH_Common/src/me/regexp/This version has been modified to build on BB platform, and compiles on 4.3 -> 5.0
Marc Paradise