Better global volume adjustment on a voice. Fixes one of the 2 issues with the HOME button menu sound.

This commit is contained in:
Pierre Bourdon 2013-01-20 17:36:57 +01:00
parent 7252becf24
commit 4ef021e975
1 changed files with 1 additions and 2 deletions

View File

@ -364,8 +364,7 @@ void ProcessVoice(PB_TYPE& pb, const AXBuffers& buffers, AXMixControl mctrl)
// Apply a global volume ramp using the volume envelope parameters.
for (u32 i = 0; i < SAMPLES_PER_FRAME; ++i)
{
s64 sample = 2 * (s16)samples[i] * (s16)pb.vol_env.cur_volume;
samples[i] = (s16)(sample >> 16);
samples[i] = ((s32)samples[i] * pb.vol_env.cur_volume) >> 15;
pb.vol_env.cur_volume += pb.vol_env.cur_volume_delta;
}