Mercurial > hg > beaglert
comparison 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 |
comparison
equal
deleted
inserted
replaced
119:c692827083e1 | 120:cdd441a304a9 |
---|---|
82 gPhase1 -= 2.0 * M_PI; | 82 gPhase1 -= 2.0 * M_PI; |
83 if(gPhase2 > 2.0 * M_PI) | 83 if(gPhase2 > 2.0 * M_PI) |
84 gPhase2 -= 2.0 * M_PI; | 84 gPhase2 -= 2.0 * M_PI; |
85 | 85 |
86 } | 86 } |
87 static float buffer[2][32]; //this should be context->audioFrames | |
88 if(count==0){ | |
89 memset(buffer,2*32*sizeof(float),0); | |
90 } | |
91 if(count>0){ | 87 if(count>0){ |
92 int readPointer0=receiveAudio0.getSamplesSrc(buffer[0], context->audioFrames, 1); | 88 int readPointer0=receiveAudio0.getSamplesSrc(context->audioOut, context->audioFrames, 1, 2, 0); |
93 int readPointer1=receiveAudio1.getSamplesSrc(buffer[1], context->audioFrames, 1); | 89 int readPointer1=receiveAudio1.getSamplesSrc(context->audioOut, context->audioFrames, 1, 2, 1); |
94 for(unsigned int n=0; n<context->audioFrames; n++){ | |
95 context->audioOut[n*2]=buffer[0][n]; | |
96 context->audioOut[n*2+1]=buffer[1][n]; | |
97 } | |
98 } | 90 } |
99 count++; | 91 count++; |
100 } | 92 } |
101 | 93 |
102 // cleanup_render() is called once at the end, after the audio has stopped. | 94 // cleanup_render() is called once at the end, after the audio has stopped. |