Mercurial > hg > beaglert
diff projects/scope/render.cpp @ 120:cdd441a304a9 scope-refactoring
Added read to interleaved buffer
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 21 Aug 2015 15:52:37 +0100 |
parents | c692827083e1 |
children | bc514f29c3aa |
line wrap: on
line diff
--- a/projects/scope/render.cpp Fri Aug 21 15:21:34 2015 +0100 +++ b/projects/scope/render.cpp Fri Aug 21 15:52:37 2015 +0100 @@ -84,17 +84,9 @@ gPhase2 -= 2.0 * M_PI; } - static float buffer[2][32]; //this should be context->audioFrames - if(count==0){ - memset(buffer,2*32*sizeof(float),0); - } if(count>0){ - int readPointer0=receiveAudio0.getSamplesSrc(buffer[0], context->audioFrames, 1); - int readPointer1=receiveAudio1.getSamplesSrc(buffer[1], context->audioFrames, 1); - for(unsigned int n=0; n<context->audioFrames; n++){ - context->audioOut[n*2]=buffer[0][n]; - context->audioOut[n*2+1]=buffer[1][n]; - } + int readPointer0=receiveAudio0.getSamplesSrc(context->audioOut, context->audioFrames, 1, 2, 0); + int readPointer1=receiveAudio1.getSamplesSrc(context->audioOut, context->audioFrames, 1, 2, 1); } count++; }