Skip to content

Commit

Permalink
Make hard-coded buffer size more conservative (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdatkinson authored Jan 21, 2024
1 parent b62f49c commit 7fc7d9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dsp/ResamplingContainer/Dependencies/LanczosResampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ class LanczosResampler

// The buffer size. This needs to be at least as large as the largest block of samples
// that the input side will see.
static constexpr size_t kBufferSize = 4096;
// WARNING: hard-coded to accommodate 8192 samples, from 44.1 to 192k!
// If someone is past this, then maybe they know what they're doing ;)
// (size_t)(8192 * 3 * 192000 / 44100)+1 = 106998
static constexpr size_t kBufferSize = 131072; // Round up to pow2. I don't know why, but it doesn't work otherwise.
// The filter width. 2x because the filter goes from -A to A
static constexpr size_t kFilterWidth = A * 2;
// The discretization resolution for the filter table.
Expand Down

0 comments on commit 7fc7d9a

Please sign in to comment.