Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Talkthrough.h"
- //--------------------------------------------------------------------------//
- // 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. //
- //--------------------------------------------------------------------------//
- #define BUFFOR_SIZE 10000
- int Buffor[BUFFOR_SIZE] = { 0 };
- int Buffor_Pozycja = 0;
- int GetFromBuffer(int index)
- {
- return Buffor[(Buffor_Pozycja + index) % BUFFOR_SIZE];
- }
- void Echo(void)
- {
- int value = iChannel0LeftIn<<8;
- Buffor[Buffor_Pozycja] = value;
- iChannel0LeftOut = (value / 2 + GetFromBuffer(1) / 4) >> 8;
- iChannel0RightOut = iChannel0LeftOut;
- Buffor_Pozycja = (Buffor_Pozycja + 1) % BUFFOR_SIZE;
- }
- void Process_Data(void)
- {
- Echo();
- //iChannel0LeftOut = iChannel0LeftIn;
- //iChannel0RightOut = iChannel0RightIn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement