mirror of
https://github.com/LX3JL/xlxd.git
synced 2026-04-06 23:13:44 +00:00
Back to block processing, more efficient and does not introduce delay
This commit is contained in:
parent
1770dc188f
commit
042188770b
9 changed files with 85 additions and 57 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue