Package javazoom.spi.mpeg.sampled.file.tag

Examples of javazoom.spi.mpeg.sampled.file.tag.IcyInputStream


        InputStream inputStream = null;
        // Is is a shoutcast server ?
        if (isShout == true)
        {
            // Yes
            IcyInputStream icyStream = new IcyInputStream(bInputStream);
            icyStream.addTagParseListener(IcyListener.getInstance());
            inputStream = icyStream;
        }
        else
        {
            // No, is Icecast 2 ?
            String metaint = conn.getHeaderField("icy-metaint");
            if (metaint != null)
            {
                // Yes, it might be icecast 2 mp3 stream.
                IcyInputStream icyStream = new IcyInputStream(bInputStream, metaint);
                icyStream.addTagParseListener(IcyListener.getInstance());
                inputStream = icyStream;
            }
            else
            {
                // No
View Full Code Here


     * @param props
     * @throws IOException
     */
    protected void loadShoutcastInfo(InputStream input, HashMap 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);
            }
        }
    }
View Full Code Here

TOP

Related Classes of javazoom.spi.mpeg.sampled.file.tag.IcyInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.