
Untitled
By: a guest on
Jul 18th, 2012 | syntax:
None | size: 1.14 KB | hits: 8 | expires: Never
ACRE_RESULT CFilterRadio::process(short* samples, int sampleCount, int channels) {
float buffer[4096], *floatPointer[1], random;
short *shortPointer[1];
int divisor;
if(this->getValue() > 0.0f) {
floatPointer[0] = buffer;
shortPointer[0] = samples;
Dsp::copy(1, sampleCount, floatPointer, shortPointer);
Dsp::normalize(buffer, sampleCount);
// stuff here?!?
this->mLowPass.process(sampleCount, floatPointer);
this->mHighPass.process(sampleCount, floatPointer);
for(int i = 0; i < sampleCount; i ++) {
buffer[i] = buffer[i] * 1.7;
}
this->mixNoise(buffer, sampleCount);
Dsp::denormalize(buffer, sampleCount);
Dsp::copy(1, sampleCount, shortPointer, floatPointer);
// do something here?
// 5 sounds perfect for good signal, 20 sounds shitty, 30 is basically cant hear it
divisor = 13 - (this->getValue() * 10);
if(divisor < 5)
divisor = 5;
for(int i = 0; i < sampleCount; i += divisor) {
for(int x = 1; x < divisor; x++ ) {
samples[i+x] = samples[i];
}
}
this->reset();
} else {
memset(samples, 0x00, (sampleCount*sizeof(short)));
}
return ACRE_OK;
}