Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Talkthrough.h"
- int bufor[48000]={0};
- int indeks = 0;
- int wyjscie = 0;
- //--------------------------------------------------------------------------//
- // 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;
- wyjscie = bufor[indeks]+sample;
- bufor[indeks]=sample;
- indeks++;
- if (indeks==47999)
- {
- indeks=0;
- }
- sample=wyjscie;
- sample=sample>>8;
- iChannel0LeftOut = sample;
- iChannel0RightOut = sample;
- iChannel1LeftOut = sample;
- iChannel1RightOut = sample;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement