Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include "Talkthrough.h"
  2.  
  3. int bufor[48000]={0};
  4. int indeks = 0;
  5. int wyjscie = 0;
  6. //--------------------------------------------------------------------------//
  7. // Function: Process_Data() //
  8. // //
  9. // Description: This function is called from inside the SPORT0 ISR every //
  10. // time a complete audio frame has been received. The new //
  11. // input samples can be found in the variables iChannel0LeftIn,//
  12. // iChannel0RightIn, iChannel1LeftIn and iChannel1RightIn //
  13. // respectively. The processed data should be stored in //
  14. // iChannel0LeftOut, iChannel0RightOut, iChannel1LeftOut, //
  15. // iChannel1RightOut, iChannel2LeftOut and iChannel2RightOut //
  16. // respectively. //
  17. //--------------------------------------------------------------------------//
  18. void Process_Data(void)
  19. {
  20. int sampleLeft=iChannel0LeftIn<<8;
  21. int sampleRight=iChannel0RightIn<<8;
  22. int sample =(sampleLeft+sampleRight)/2;
  23.  
  24.  
  25.  
  26.  
  27. wyjscie = bufor[indeks]+sample;
  28. bufor[indeks]=sample;
  29. indeks++;
  30. if (indeks==47999)
  31. {
  32. indeks=0;
  33. }
  34. sample=wyjscie;
  35.  
  36.  
  37.  
  38. sample=sample>>8;
  39. iChannel0LeftOut = sample;
  40. iChannel0RightOut = sample;
  41. iChannel1LeftOut = sample;
  42. iChannel1RightOut = sample;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement