如何从 Blackberry Storm 上的实时音频流中提取歌曲名称?
你好 我是黑莓的新手。 我正在开发一个应用程序来从实时音频流中获取歌曲名称。我能够从特定的广播服务器获取 mp3 流字节。为了获取歌曲名称,我添加了标志“Icy-metadata:1”。所以我从流中获取标头。为了获取 mp3 块大小,我使用“ Icy-metaInt"。如何识别具有此 mp3 块大小的元数据块。我正在使用以下代码。任何人都可以帮助我获取它...这里 b[off+k] 是来自服务器的字节。 ..我将整个流转换为 charArray,这是错误的,但如何根据 mp3 块大小识别metadataHeaders..
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--;
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--;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
黑莓没有原生正则表达式功能;我建议使用 regexp-me 库 (http://code.google.com/p /regexp-me/)并将其编译到您的代码中。我以前用过它,它的正则表达式支持非常好。我认为您发布的代码中的正则表达式可以正常工作。
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.