Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Talkthrough.h"
- #include "math.h"
- int second = 48000;
- int i = 0;
- int bufor[48000];
- int first = 1;
- //--------------------------------------------------------------------------//
- // Function: Process_Data() //
- // //
- // Description: This function is called from inside the SPORT0 ISR every //
- // time a complete audio frame has been received. The new //
- // input samples can be found in the variables iChannel0LeftIn,//
- // iChannel0RightIn, iChannel1LeftIn and iChannel1RightIn //
- // respectively. The processed data should be stored in //
- // iChannel0LeftOut, iChannel0RightOut, iChannel1LeftOut, //
- // iChannel1RightOut, iChannel2LeftOut and iChannel2RightOut //
- // respectively. //
- //--------------------------------------------------------------------------//
- void Process_Data(void)
- {
- int sampleLeft=iChannel0LeftIn<<8;
- int sampleRight=iChannel0RightIn<<8;
- int sample =(sampleLeft+sampleRight)/2;
- //student's code here
- int secondago = bufor[i];
- bufor[i] = sample;
- sample += secondago;
- bufor[i] += sample/2;
- i++;
- i = i % second;
- //postprocessing
- sample=sample>>8;
- iChannel0LeftOut = sample;
- iChannel0RightOut = sample;
- iChannel1LeftOut = sample;
- iChannel1RightOut = sample;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement