Koushik
Koushik

Reputation: 137

How to extract the song name from a live audio stream on the Blackberry Storm?

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--;

Upvotes: 0

Views: 490

Answers (1)

Marc Paradise
Marc Paradise

Reputation: 1939

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.

Upvotes: 1

Related Questions