Package vavi.sound.adpcm.ccitt

Examples of vavi.sound.adpcm.ccitt.G721InputStream


    protected InputStream[] getInputStreams(int streamNumber, int channels) {
        InputStream[] iss = new InputStream[2];
        if (datum[streamNumber].channels == 1) {
            if (datum[streamNumber].bits == 4) {
                InputStream in = new ByteArrayInputStream(datum[streamNumber].adpcm);
                iss[0] = new G721InputStream(in, ByteOrder.LITTLE_ENDIAN);
                if (channels != 1) {
                    InputStream inR = new ByteArrayInputStream(datum[streamNumber + 1].adpcm);
                    iss[1] = new G721InputStream(inR, ByteOrder.LITTLE_ENDIAN);
                }
            } else if (datum[streamNumber].bits == 2) {
                InputStream in = new ByteArrayInputStream(datum[streamNumber].adpcm);
                iss[0] = new G723_16InputStream(in, ByteOrder.LITTLE_ENDIAN);
                if (channels != 1) {
                    InputStream inR = new ByteArrayInputStream(datum[streamNumber + 1].adpcm);
                    iss[1] = new G723_16InputStream(inR, ByteOrder.LITTLE_ENDIAN);
                }
            }
        } else {
            if (datum[streamNumber].bits == 4) {
                InputStream in = new ByteArrayInputStream(datum[streamNumber].adpcm, 0, datum[streamNumber].adpcm.length / 2);
                iss[0] = new G721InputStream(in, ByteOrder.LITTLE_ENDIAN);
                InputStream inR = new ByteArrayInputStream(datum[streamNumber].adpcm, datum[streamNumber].adpcm.length / 2, datum[streamNumber].adpcm.length / 2);
                iss[1] = new G721InputStream(inR, ByteOrder.LITTLE_ENDIAN);
            } else if (datum[streamNumber].bits == 2) {
                InputStream in = new ByteArrayInputStream(datum[streamNumber].adpcm, 0, datum[streamNumber].adpcm.length / 2);
                iss[0] = new G723_16InputStream(in, ByteOrder.LITTLE_ENDIAN);
                InputStream inR = new ByteArrayInputStream(datum[streamNumber].adpcm, datum[streamNumber].adpcm.length / 2, datum[streamNumber].adpcm.length / 2);
                iss[1] = new G723_16InputStream(inR, ByteOrder.LITTLE_ENDIAN);
View Full Code Here

TOP

Related Classes of vavi.sound.adpcm.ccitt.G721InputStream

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.