convsize = 4096 / info.channels;
convsize = bufsize / info.channels;
    private void initVorbis() throws IOException {        // Now we can read pages        syncState.init();         // grab some data at the head of the stream.  We want the first page        // (which is guaranteed to be small and only contain the Vorbis        // stream initial header) We need the first page to get the stream        // serialno.        // submit a 4k block to libvorbis' Ogg layer        int index = syncState.buffer(4096);        byte buffer[] = syncState.data;        int bytes = in.read(buffer, index, 4096);        syncState.wrote(bytes);        // Get the first page.        if (syncState.pageout(page) != 1) {            // have we simply run out of data?  If so, we're done.            if (bytes < 4096)                return;//break;            // error case.  Must not be Vorbis data            throw new IOException(JMEAudioInputStream.INVALID_OGG_MESSAGE);        }        // Get the serial number and set up the rest of decode.        // serialno first; use it to set up a logical stream        streamState.init(page.serialno());        // extract the initial header from the first page and verify that the        // Ogg bitstream is in fact Vorbis data        // I handle the initial header first instead of just having the code        // read all three Vorbis headers at once because reading the initial        // header is an easy way to identify a Vorbis bitstream and it's        // useful to see that functionality seperated out.        info.init();        comment.init();        if (streamState.pagein(page) < 0) {            // error; stream version mismatch perhaps            throw new IOException("Error reading first page of Ogg bitstream data.");        }        if (streamState.packetout(packet) != 1) {            // no page? must not be vorbis            throw new IOException("Error reading initial header packet.");        }        if (info.synthesis_headerin(comment, packet) < 0) {            // error case; not a vorbis header            throw new IOException("This Ogg bitstream does not contain Vorbis audio data.");        }        // At this point, we're sure we're Vorbis.  We've set up the logical        // (Ogg) bitstream decoder.  Get the comment and codebook headers and        // set up the Vorbis decoder        // The next two packets in order are the comment and codebook headers.        // They're likely large and may span multiple pages.  Thus we read        // and submit data until we get our two packets, watching that no        // pages are missing.  If a page is missing, error out; losing a        // header page is the only place where missing data is fatal.                 int i = 0;        while (i < 2) {            while (i < 2) {                int result = syncState.pageout(page);                if (result == 0)                    break; // Need more data                // Don't complain about missing or corrupt data yet.  We'll                // catch it at the packet output phase                if (result == 1) {                    streamState.pagein(page); // we can ignore any errors here                    // as they'll also become apparent                    // at packetout                    while (i < 2) {                        result = streamState.packetout(packet);                        if (result == 0) {                            break;                        }                                                if (result == -1) {                            // Uh oh; data at some point was corrupted or missing!                            // We can't tolerate that in a header.  Die.                            throw new IOException("Corrupt secondary header. Exiting.");                        }                        info.synthesis_headerin(comment, packet);                        i++;                    }                }            }            // no harm in not checking before adding more            index = syncState.buffer(4096);            buffer = syncState.data;            bytes = in.read(buffer, index, 4096);            // NOTE: This is a bugfix. read will return -1 which will mess up syncState.            if (bytes < 0 ) {                bytes = 0;            }                        if (bytes == 0 && i < 2) {                throw new IOException("End of file before finding all Vorbis headers!");            }            syncState.wrote(bytes);        }        convsize = 4096 / info.channels;        // OK, got and parsed all three headers. Initialize the Vorbis        //  packet->PCM decoder.        dspState.synthesis_init(info); // central decode state        block.init(dspState); // local state for most of the decode        // so multiple block decodes can        // proceed in parallel.  We could init        // multiple vorbis_block structures        // for vd here    }