public float[] getFrameLinear(int currentSample, float fractionOffset) {
        if(currentSample >= 0 && currentSample < nFrames) {
            for (int i = 0; i < nChannels; i++) {
                if(currentSample < (nFrames - 1)) {
                    result[i] = (1f - fractionOffset) * buf[i][currentSample] +
                            fractionOffset * buf[i][currentSample + 1];
                } else {
                    result[i] = buf[i][currentSample];
                }   
            }
        } else {
             for(int i = 0; i < nChannels; i++) {
                 result[i] = 0.0f;
             }
        }
        return result;
    }