Index: Source/platform/audio/HRTFPanner.cpp |
diff --git a/Source/platform/audio/HRTFPanner.cpp b/Source/platform/audio/HRTFPanner.cpp |
index 63d9fc49628394fbba237fa1de46c6c77615b84d..7f5fb5d3e6178165d183732c4de956358b26738b 100644 |
--- a/Source/platform/audio/HRTFPanner.cpp |
+++ b/Source/platform/audio/HRTFPanner.cpp |
@@ -79,8 +79,18 @@ size_t HRTFPanner::fftSizeForSampleRate(float sampleRate) |
// The HRTF impulse responses (loaded as audio resources) are 512 sample-frames @44.1KHz. |
// Currently, we truncate the impulse responses to half this size, but an FFT-size of twice impulse response size is needed (for convolution). |
// So for sample rates around 44.1KHz an FFT size of 512 is good. We double the FFT-size only for sample rates at least double this. |
- ASSERT(sampleRate >= 44100 && sampleRate <= 96000.0); |
- return (sampleRate < 88200.0) ? 512 : 1024; |
+ ASSERT(sampleRate >= 22050 && sampleRate <= 96000.0); |
+ |
+ size_t fftSize = 256; |
+ |
+ if (sampleRate < 44100) |
+ fftSize = 256; |
+ else if (sampleRate >= 44100 && sampleRate < 88200.0) |
+ fftSize = 512; |
+ else if (sampleRate < 88200.0) |
Inactive
2014/07/15 15:49:40
I am guessing you want '>', not '>'. We could simp
|
+ fftSize = 1024; |
+ |
+ return fftSize; |
} |
void HRTFPanner::reset() |