From 79350687941bf04146ac10f90d851eda248b7b87 Mon Sep 17 00:00:00 2001 From: Brandon Jones Date: Tue, 28 Jul 2026 17:04:27 -0400 Subject: [PATCH] docs(core): Correct the documented default interpolation strategy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SoundTouchOptions.interpolationStrategy carried `@defaultValue 'linear'`, but the default is `lanczos`: RateTransposer's constructor ends with `setInterpolationStrategy(interpolationStrategy ?? 'lanczos')`, and lanczos is the only strategy registered out of the box. The wrong value is worse than cosmetic here. `linear` ships in @soundtouchjs/interpolation-strategy-linear and has to be registered before use, so following the doc and passing `'linear'` throws "Unknown interpolation strategy id" from construction. The README already describes the registry correctly and shows the registerLinearStrategy opt-in, so this was the only place stating otherwise. Adds a spec pinning the default, which nothing covered — the existing strategy specs all pass an explicit id. --- packages/core/src/SoundTouch.spec.ts | 4 ++++ packages/core/src/SoundTouch.ts | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/core/src/SoundTouch.spec.ts b/packages/core/src/SoundTouch.spec.ts index f86068e..cf58a4e 100644 --- a/packages/core/src/SoundTouch.spec.ts +++ b/packages/core/src/SoundTouch.spec.ts @@ -227,6 +227,10 @@ describe('SoundTouch', () => { }); describe('runtime interpolation strategy controls', () => { + it('defaults to the only strategy registered out of the box', () => { + expect(new SoundTouch().interpolationStrategy).toBe('lanczos'); + }); + it('switches interpolation strategy through SoundTouch API', () => { const st = new SoundTouch({ interpolationStrategy: 'lanczos' }); diff --git a/packages/core/src/SoundTouch.ts b/packages/core/src/SoundTouch.ts index 92a1c57..e85d560 100644 --- a/packages/core/src/SoundTouch.ts +++ b/packages/core/src/SoundTouch.ts @@ -67,7 +67,12 @@ export interface SoundTouchOptions { /** * Interpolation strategy used by the rate transposer stage. * - * @defaultValue 'linear' + * @remarks + * Only `lanczos` is registered out of the box. Every other id — including + * `linear` — comes from an `@soundtouchjs/interpolation-strategy-*` package + * and must be registered before it can be named here, or construction throws. + * + * @defaultValue 'lanczos' */ interpolationStrategy?: RateTransposerInterpolationStrategy;