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);