如何从 Blackberry Storm 上的实时音频流中提取歌曲名称?

发布于 2024-09-10 19:26:36 字数 655 浏览 2 评论 0原文

你好 我是黑莓的新手。 我正在开发一个应用程序来从实时音频流中获取歌曲名称。我能够从特定的广播服务器获取 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╄→承喏 2024-09-17 19:26:38

黑莓没有原生正则表达式功能;我建议使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文