public int writeSampleData ( final byte [ ] newSampleData , final int offset , int length ) { synchronized ( lock ) { System . arraycopy ( newSampleData , offset , resultSampleBuffer , 0 , length ) ; int anzSamples = writeIntoFloatArrayBuffer ( length ) ; if ( dspEnabled ) { // call the callbacks for digital signal processing // ... anzSamples = callEffects ( sampleBuffer , currentWritePosition , anzSamples ) ; // and recalc from the float array... length = readFromFloatArrayBuffer ( anzSamples ) ; } currentWritePosition = ( currentWritePosition + anzSamples ) % sampleBufferSize ; return length ; } }
This method will write the sample data to the dsp buffer It will convert all sampledata to a stereo or mono float of 1 . 0< = x< = - 1 . 0