mirror of
https://github.com/ShaYmez/xlxd.git
synced 2026-06-09 09:04:45 -04:00
Back to block processing, more efficient and does not introduce delay
This commit is contained in:
+11
-2
@@ -38,7 +38,16 @@ CFixedGain::CFixedGain(float gaindB)
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// processing
|
||||
|
||||
inline float CFixedGain::ProcessSample(float input)
|
||||
inline void CFixedGain::ProcessSampleBlock(uint8* voice, int length)
|
||||
{
|
||||
return input * m_gainLinear;
|
||||
for(int i = 0; i < length; i++)
|
||||
{
|
||||
float input = (float)(short)MAKEWORD(voice[i+1], voice[i]);
|
||||
//apply gain
|
||||
float output = input * m_gainLinear;
|
||||
|
||||
//write processed sample back
|
||||
voice[i] = HIBYTE((short)output);
|
||||
voice[i+1] = LOBYTE((short)output);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user