how to get informed of new song info while retrieving metadata from shoutcast stream

时光怂恿深爱的人放手 提交于 2019-12-04 17:09:00

You must remember number from icy-metaint header field.

After receiving that many bytes from stream (which you send to audio decoder), you must expect metadata part, and read this (also not sending these data to audio decoder). Then you again receive encoded audio from stream, and continue the process of periodically reading metadata after icy-metaint bytes.

This means that server sends metadata (info about artist / song title) periodically, and your code must split the input stream to audio and metadata.

pingw33n
  1. You're not supposed to open new connection for metadata. Metadata is integrated into MP3 stream (all this is described in the link you posted).
  2. If you close the connection obviously you're no longer be able to receive MP3 stream nor metadata.
  3. See: Streaming Audio from A URL in Android using MediaPlayer?
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!