HRTF DSP: Add gain correction to impulse resampler
Impulses should be gain scaled roughly based on the sample ratio relative to the original impulses. Lower target sample rate means less impulses means gain goes up, higher target sample rate means more impulses so gain goes down. Somewhat simple, seems to work. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
9346a4edbd
commit
8790df1ef0
1 changed files with 1 additions and 0 deletions
|
@ -191,6 +191,7 @@ static impulseSetCache *_sharedController = nil;
|
|||
if(resampling) {
|
||||
sampleCountResampled = (uint32_t)(((double)sampleCountExact) * sampleRate / sampleRateOfSource);
|
||||
actualSampleCount = (uint32_t)(((double)actualSampleCount) * sampleRate / sampleRateOfSource);
|
||||
io_spec.scale = sampleRateOfSource / sampleRate;
|
||||
}
|
||||
actualSampleCount = (actualSampleCount + 15) & ~15;
|
||||
|
||||
|
|
Loading…
Reference in a new issue