public int readMono(short[] outputArray) throws IOException {
        if (this.nChannels == 1) {
            return read(outputArray);
        } else {
            int len = outputArray.length;
            short[] stereoArray = new short[len * 2];
            int bytesRead = read(stereoArray);
            for (int i = 0; i < len; i++) {
                outputArray[i] = (short) ((short) (stereoArray[i * 2] + stereoArray[i * 2 + 1]) / 2);
            }

            if (bytesRead == -1)
                return -1;
            return bytesRead / 2;
        }
    }