?? process_samples.c
字號(hào):
#include <def21262.h>
#include "kr.h"
//This subroutine is called for every sport interrupt. It's function is
//to sweep the audio balance from right to left and back to right again.
//This is synchronized with the LED sweeping. Note, the sample has some
//ambient sound at the end, so the middle of the sweep is NOT the middle
//of the entire audio sample.
void process_sample(void)
{
int current_addr;
//current offset into sample
current_addr=(FirstSample->CurrentAddr - FirstSample->StartAddr);
//For the first half of sweep percieved source shifts left<-right
if (current_addr <= SWEEP_MIDDLE) {
//the global float step is simply 1/SWEEP_MIDDLE, and
//allows the gain to move from 0<->1 over half the sample.
//decrease Rgain
Rgain = 1-(step*current_addr);
//increse Lgain
Lgain = (step*current_addr);
}
// for second half of sweep, shift source left->right
if ((current_addr>SWEEP_MIDDLE)&(current_addr<=2*SWEEP_MIDDLE) ){
//decrease Lgain
Lgain = 1-(step*(current_addr-(float)SWEEP_MIDDLE));
//decrease Rgain
Rgain = (step*(current_addr-(float)SWEEP_MIDDLE));
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -