mirror of
https://github.com/LX3JL/xlxd.git
synced 2026-04-04 14:07:31 +00:00
Reduce processing delay
Process one packet all at once
This commit is contained in:
parent
5356f37fd8
commit
02a583f0b3
14 changed files with 298 additions and 116 deletions
|
|
@ -69,18 +69,3 @@ void CVoicePacket::SetVoice(const uint8 *voice, int size)
|
|||
::memcpy(m_uiVoice, voice, m_iSize);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// gain
|
||||
|
||||
void CVoicePacket::ApplyGain(int dB)
|
||||
{
|
||||
float mult = pow(10, dB/20.0);
|
||||
for ( int i = 0; i < m_iSize; i += 2 )
|
||||
{
|
||||
float smp = (float)(short)MAKEWORD(m_uiVoice[i+1], m_uiVoice[i]);
|
||||
smp *= mult;
|
||||
m_uiVoice[i] = HIBYTE((short)smp);
|
||||
m_uiVoice[i+1] = LOBYTE((short)smp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue