Chromium Code Reviews| Index: Source/platform/audio/HRTFPanner.cpp |
| diff --git a/Source/platform/audio/HRTFPanner.cpp b/Source/platform/audio/HRTFPanner.cpp |
| index bab33c8173f42faf16cff3bb267d22271e99306c..bfc6b473946c5c1e9b3d07f8ff882e3bab2f8c8b 100644 |
| --- a/Source/platform/audio/HRTFPanner.cpp |
| +++ b/Source/platform/audio/HRTFPanner.cpp |
| @@ -77,8 +77,22 @@ 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 >= 3000 && sampleRate <= 192000); |
| + |
| + if (sampleRate < 5512.5) |
|
Raymond Toy
2014/09/05 21:01:43
Actually, I was just looking. I think we can do be
KhNo
2014/09/05 21:29:16
int impulseLength = 256;
float impulseSampleRa
|
| + return 32; |
| + if (sampleRate < 11025) |
| + return 64; |
| + if (sampleRate < 22050) |
| + return 128; |
| + if (sampleRate < 44100) |
| + return 256; |
| + if (sampleRate < 88200) |
| + return 512; |
| + if (sampleRate < 176400) |
| + return 1024; |
| + |
| + return 2048; |
| } |
| void HRTFPanner::reset() |