use of javazoom.spi.mpeg.sampled.file.tag.MP3Tag in project Minim by ddf.
the class MpegAudioFileReader method loadShoutcastInfo.
/**
* Load shoutcast (ICY) info.
*
* @param input
* @param props
* @throws IOException
*/
protected void loadShoutcastInfo(InputStream input, HashMap<String, Object> props) throws IOException {
IcyInputStream icy = new IcyInputStream(new BufferedInputStream(input));
// HashMap metadata = icy.getTagHash();
MP3Tag titleMP3Tag = icy.getTag("icy-name");
if (titleMP3Tag != null)
props.put("title", ((String) titleMP3Tag.getValue()).trim());
MP3Tag[] meta = icy.getTags();
if (meta != null) {
// StringBuffer metaStr = new StringBuffer();
for (int i = 0; i < meta.length; i++) {
String key = meta[i].getName();
String value = ((String) icy.getTag(key).getValue()).trim();
props.put("mp3.shoutcast.metadata." + key, value);
}
}
}
Aggregations