@soundtouchjs/worklet-base 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist/SoundTouchProcessorBase.d.ts +134 -0
- package/.dist/SoundTouchProcessorBase.d.ts.map +1 -0
- package/.dist/SoundTouchProcessorBase.js +271 -0
- package/.dist/SoundTouchProcessorBase.js.map +1 -0
- package/.dist/index.d.ts +4 -0
- package/.dist/index.d.ts.map +1 -0
- package/.dist/index.js +3 -0
- package/.dist/index.js.map +1 -0
- package/.dist/tsconfig.tsbuildinfo +1 -0
- package/.dist/types.d.ts +57 -0
- package/.dist/types.d.ts.map +1 -0
- package/.dist/types.js +28 -0
- package/.dist/types.js.map +1 -0
- package/LICENSE +5 -0
- package/README.md +121 -0
- package/package.json +51 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { SoundTouch } from '@soundtouchjs/core';
|
|
2
|
+
import type { RateTransposerInterpolationStrategy, SoundTouchOptions } from '@soundtouchjs/core';
|
|
3
|
+
import type { ProcessCoreResult } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base class for all SoundTouchJS AudioWorklet processor implementations.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Centralises shared state (pipe, sample buffers, runtime-update queue), the
|
|
9
|
+
* `applyPendingRuntimeUpdates` helper, and the core DSP pipeline in
|
|
10
|
+
* `processCore`. Subclasses must implement `process` and `onProcessComplete`.
|
|
11
|
+
*
|
|
12
|
+
* The default `process` implementation calls `applyPendingRuntimeUpdates`,
|
|
13
|
+
* `processCore`, and then `onProcessComplete`. Subclasses that need to
|
|
14
|
+
* interleave additional logic (e.g. LPC analysis) can override `beforePipeProcess`
|
|
15
|
+
* and/or `extractSamples` instead of overriding `process` entirely.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class SoundTouchProcessorBase extends AudioWorkletProcessor {
|
|
18
|
+
/** The SoundTouch DSP pipeline instance. */
|
|
19
|
+
protected _pipe: SoundTouch;
|
|
20
|
+
/** Interleaved (L, R, L, R, …) input staging buffer. */
|
|
21
|
+
protected _samples: Float32Array;
|
|
22
|
+
/** Interleaved output staging buffer populated by `extractSamples`. */
|
|
23
|
+
protected _outputSamples: Float32Array;
|
|
24
|
+
/** Cumulative count of render blocks where the output buffer ran short. */
|
|
25
|
+
protected _underrunCount: number;
|
|
26
|
+
/** Total render blocks processed since construction. */
|
|
27
|
+
protected _blockCount: number;
|
|
28
|
+
private _pendingInterpolationStrategy;
|
|
29
|
+
private _pendingInterpolationStrategyParams;
|
|
30
|
+
private _pendingStretchParameters;
|
|
31
|
+
/** Label used in console messages (e.g. `'[SoundTouchProcessor]'`). */
|
|
32
|
+
protected readonly processorLabel: string;
|
|
33
|
+
/**
|
|
34
|
+
* Validates and resolves an interpolation strategy id, falling back to
|
|
35
|
+
* `'lanczos'` if the id is unrecognised.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* Call this as a static expression inside the `super()` argument list of a
|
|
39
|
+
* subclass constructor so that strategy resolution happens before pipe creation.
|
|
40
|
+
*
|
|
41
|
+
* @param strategy - The strategy id provided by the caller.
|
|
42
|
+
* @param processorLabel - Label included in the fallback console message.
|
|
43
|
+
* @returns The original `strategy` if valid, or `'lanczos'` as a fallback.
|
|
44
|
+
*/
|
|
45
|
+
static resolveStrategy(strategy: RateTransposerInterpolationStrategy | undefined, processorLabel: string): RateTransposerInterpolationStrategy | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* @param processorLabel - Label string used in diagnostic messages.
|
|
48
|
+
* @param pipeOptions - Options forwarded to the `SoundTouch` constructor. The
|
|
49
|
+
* `sampleRate` global must be available in the AudioWorklet scope.
|
|
50
|
+
*/
|
|
51
|
+
constructor(processorLabel: string, pipeOptions: SoundTouchOptions);
|
|
52
|
+
/**
|
|
53
|
+
* Flushes any pending interpolation-strategy or stretch-parameter change
|
|
54
|
+
* that arrived via `port.onmessage` since the last render block.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Call this at the top of `process` before touching `_pipe`.
|
|
58
|
+
*/
|
|
59
|
+
protected applyPendingRuntimeUpdates(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Optional hook called after input routing and buffer resize but **before**
|
|
62
|
+
* the SoundTouch pipe processes the block.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* Override in subclasses that need to inspect or transform the raw input
|
|
66
|
+
* before it enters the DSP pipeline (e.g. computing LPC coefficients).
|
|
67
|
+
*
|
|
68
|
+
* @param _leftInput - Left-channel input for this render block.
|
|
69
|
+
* @param _rightInput - Right-channel input (same as left for mono sources).
|
|
70
|
+
* @param _frameCount - Number of frames in this block.
|
|
71
|
+
* @param _parameters - AudioParam k-rate values for this render block.
|
|
72
|
+
*/
|
|
73
|
+
protected beforePipeProcess(_leftInput: Float32Array, _rightInput: Float32Array, _frameCount: number, _parameters: Record<string, Float32Array>): void;
|
|
74
|
+
/**
|
|
75
|
+
* Extracts rendered frames from the output buffer, writes them to
|
|
76
|
+
* `leftOutput`/`rightOutput`, zero-fills any gap, and returns RMS/peak metrics.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* Override in subclasses that apply post-extraction transforms (e.g. formant
|
|
80
|
+
* correction). Overrides are responsible for the full extraction, write-back,
|
|
81
|
+
* silence fill, and returning `{ outputRms, outputPeak }`.
|
|
82
|
+
*
|
|
83
|
+
* @param leftOutput - Destination view for the left channel.
|
|
84
|
+
* @param rightOutput - Destination view for the right channel.
|
|
85
|
+
* @param frameCount - Total frames expected in this block.
|
|
86
|
+
* @param toExtract - Frames available to extract (≤ frameCount).
|
|
87
|
+
* @param _parameters - AudioParam k-rate values (available for overrides).
|
|
88
|
+
* @returns RMS and peak of the extracted block.
|
|
89
|
+
*/
|
|
90
|
+
protected extractSamples(leftOutput: Float32Array, rightOutput: Float32Array, frameCount: number, toExtract: number, _parameters: Record<string, Float32Array>): {
|
|
91
|
+
outputRms: number;
|
|
92
|
+
outputPeak: number;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Runs the full DSP pipeline for one render block and returns metrics.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* Handles input routing, buffer resize, `beforePipeProcess`, pitch
|
|
99
|
+
* calculation, sample interleaving, pipe feed/process, counter updates,
|
|
100
|
+
* and `extractSamples`. Returns `null` when the input is empty or
|
|
101
|
+
* the output has not been allocated, keeping the processor alive.
|
|
102
|
+
*
|
|
103
|
+
* @param inputs - AudioWorklet input buses.
|
|
104
|
+
* @param outputs - AudioWorklet output buses.
|
|
105
|
+
* @param parameters - k-rate AudioParam values.
|
|
106
|
+
* @returns Render-block result, or `null` if inputs are not ready.
|
|
107
|
+
*/
|
|
108
|
+
protected processCore(inputs: Float32Array[][], outputs: Float32Array[][], parameters: Record<string, Float32Array>): ProcessCoreResult | null;
|
|
109
|
+
/**
|
|
110
|
+
* Called after a successful `processCore` invocation with the render-block result.
|
|
111
|
+
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* Implement this to post processor-specific metrics to the main thread.
|
|
114
|
+
* The default `process` implementation calls this after `processCore`.
|
|
115
|
+
*
|
|
116
|
+
* @param result - Data from the completed render block.
|
|
117
|
+
*/
|
|
118
|
+
protected abstract onProcessComplete(result: ProcessCoreResult): void;
|
|
119
|
+
/**
|
|
120
|
+
* AudioWorkletProcessor render callback. Keeps the processor alive by always returning `true`.
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* The default implementation calls `applyPendingRuntimeUpdates`, `processCore`,
|
|
124
|
+
* and `onProcessComplete`. Override only when the execution order must differ
|
|
125
|
+
* (e.g. pre-pipe analysis steps not covered by `beforePipeProcess`).
|
|
126
|
+
*
|
|
127
|
+
* @param inputs - AudioWorklet input buses.
|
|
128
|
+
* @param outputs - AudioWorklet output buses.
|
|
129
|
+
* @param parameters - k-rate AudioParam values.
|
|
130
|
+
* @returns Always `true` to keep the processor alive.
|
|
131
|
+
*/
|
|
132
|
+
process(inputs: Float32Array[][], outputs: Float32Array[][], parameters: Record<string, Float32Array>): boolean;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=SoundTouchProcessorBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoundTouchProcessorBase.d.ts","sourceRoot":"","sources":["../src/SoundTouchProcessorBase.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAgC,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAEV,mCAAmC,EACnC,iBAAiB,EAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,8BAAsB,uBAAwB,SAAQ,qBAAqB;IACzE,4CAA4C;IAC5C,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC;IAC5B,wDAAwD;IACxD,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC;IACjC,uEAAuE;IACvE,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC;IACvC,2EAA2E;IAC3E,SAAS,CAAC,cAAc,SAAK;IAC7B,wDAAwD;IACxD,SAAS,CAAC,WAAW,SAAK;IAE1B,OAAO,CAAC,6BAA6B,CAC9B;IACP,OAAO,CAAC,mCAAmC,CACpC;IACP,OAAO,CAAC,yBAAyB,CAAkC;IAEnE,uEAAuE;IACvE,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAE1C;;;;;;;;;;;OAWG;WACW,eAAe,CAC3B,QAAQ,EAAE,mCAAmC,GAAG,SAAS,EACzD,cAAc,EAAE,MAAM,GACrB,mCAAmC,GAAG,SAAS;IAgBlD;;;;OAIG;gBACS,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB;IA0BlE;;;;;;OAMG;IACH,SAAS,CAAC,0BAA0B,IAAI,IAAI;IAwC5C;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,iBAAiB,CACzB,UAAU,EAAE,YAAY,EACxB,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GACxC,IAAI;IAIP;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,cAAc,CACtB,UAAU,EAAE,YAAY,EACxB,WAAW,EAAE,YAAY,EACzB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GACxC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE;IA8B5C;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,WAAW,CACnB,MAAM,EAAE,YAAY,EAAE,EAAE,EACxB,OAAO,EAAE,YAAY,EAAE,EAAE,EACzB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GACvC,iBAAiB,GAAG,IAAI;IAqE3B;;;;;;;;OAQG;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAErE;;;;;;;;;;;;OAYG;IACH,OAAO,CACL,MAAM,EAAE,YAAY,EAAE,EAAE,EACxB,OAAO,EAAE,YAAY,EAAE,EAAE,EACzB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GACvC,OAAO;CAQX"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SoundTouch JS audio processing library
|
|
3
|
+
* Copyright (c) Steve 'Cutter' Blades
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Mozilla Public License, v. 2.0.
|
|
6
|
+
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
import { SoundTouch, resolveInterpolationStrategy } from '@soundtouchjs/core';
|
|
9
|
+
/**
|
|
10
|
+
* Abstract base class for all SoundTouchJS AudioWorklet processor implementations.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Centralises shared state (pipe, sample buffers, runtime-update queue), the
|
|
14
|
+
* `applyPendingRuntimeUpdates` helper, and the core DSP pipeline in
|
|
15
|
+
* `processCore`. Subclasses must implement `process` and `onProcessComplete`.
|
|
16
|
+
*
|
|
17
|
+
* The default `process` implementation calls `applyPendingRuntimeUpdates`,
|
|
18
|
+
* `processCore`, and then `onProcessComplete`. Subclasses that need to
|
|
19
|
+
* interleave additional logic (e.g. LPC analysis) can override `beforePipeProcess`
|
|
20
|
+
* and/or `extractSamples` instead of overriding `process` entirely.
|
|
21
|
+
*/
|
|
22
|
+
export class SoundTouchProcessorBase extends AudioWorkletProcessor {
|
|
23
|
+
/** The SoundTouch DSP pipeline instance. */
|
|
24
|
+
_pipe;
|
|
25
|
+
/** Interleaved (L, R, L, R, …) input staging buffer. */
|
|
26
|
+
_samples;
|
|
27
|
+
/** Interleaved output staging buffer populated by `extractSamples`. */
|
|
28
|
+
_outputSamples;
|
|
29
|
+
/** Cumulative count of render blocks where the output buffer ran short. */
|
|
30
|
+
_underrunCount = 0;
|
|
31
|
+
/** Total render blocks processed since construction. */
|
|
32
|
+
_blockCount = 0;
|
|
33
|
+
_pendingInterpolationStrategy = null;
|
|
34
|
+
_pendingInterpolationStrategyParams = null;
|
|
35
|
+
_pendingStretchParameters = null;
|
|
36
|
+
/** Label used in console messages (e.g. `'[SoundTouchProcessor]'`). */
|
|
37
|
+
processorLabel;
|
|
38
|
+
/**
|
|
39
|
+
* Validates and resolves an interpolation strategy id, falling back to
|
|
40
|
+
* `'lanczos'` if the id is unrecognised.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Call this as a static expression inside the `super()` argument list of a
|
|
44
|
+
* subclass constructor so that strategy resolution happens before pipe creation.
|
|
45
|
+
*
|
|
46
|
+
* @param strategy - The strategy id provided by the caller.
|
|
47
|
+
* @param processorLabel - Label included in the fallback console message.
|
|
48
|
+
* @returns The original `strategy` if valid, or `'lanczos'` as a fallback.
|
|
49
|
+
*/
|
|
50
|
+
static resolveStrategy(strategy, processorLabel) {
|
|
51
|
+
try {
|
|
52
|
+
if (strategy) {
|
|
53
|
+
resolveInterpolationStrategy(strategy);
|
|
54
|
+
}
|
|
55
|
+
return strategy;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
console.info(`${processorLabel} Unknown interpolation strategy id:`, strategy, '— falling back to lanczos.');
|
|
59
|
+
return 'lanczos';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @param processorLabel - Label string used in diagnostic messages.
|
|
64
|
+
* @param pipeOptions - Options forwarded to the `SoundTouch` constructor. The
|
|
65
|
+
* `sampleRate` global must be available in the AudioWorklet scope.
|
|
66
|
+
*/
|
|
67
|
+
constructor(processorLabel, pipeOptions) {
|
|
68
|
+
super();
|
|
69
|
+
this.processorLabel = processorLabel;
|
|
70
|
+
this._pipe = new SoundTouch(pipeOptions);
|
|
71
|
+
this._samples = new Float32Array(128 * 2);
|
|
72
|
+
this._outputSamples = new Float32Array(128 * 2);
|
|
73
|
+
const port = this.port;
|
|
74
|
+
if (port !== undefined) {
|
|
75
|
+
port.onmessage = (event) => {
|
|
76
|
+
const message = event.data;
|
|
77
|
+
if (message.type === 'set-interpolation-strategy') {
|
|
78
|
+
this._pendingInterpolationStrategy = message.strategy;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (message.type === 'set-interpolation-strategy-params') {
|
|
82
|
+
this._pendingInterpolationStrategyParams = message.params;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (message.type === 'set-stretch-parameters') {
|
|
86
|
+
this._pendingStretchParameters = message.params;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Flushes any pending interpolation-strategy or stretch-parameter change
|
|
93
|
+
* that arrived via `port.onmessage` since the last render block.
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* Call this at the top of `process` before touching `_pipe`.
|
|
97
|
+
*/
|
|
98
|
+
applyPendingRuntimeUpdates() {
|
|
99
|
+
if (this._pendingInterpolationStrategy !== null) {
|
|
100
|
+
try {
|
|
101
|
+
this._pipe.setInterpolationStrategy(this._pendingInterpolationStrategy);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
console.info(`${this.processorLabel} Failed to switch interpolation strategy:`, this._pendingInterpolationStrategy);
|
|
105
|
+
}
|
|
106
|
+
this._pendingInterpolationStrategy = null;
|
|
107
|
+
}
|
|
108
|
+
if (this._pendingInterpolationStrategyParams !== null) {
|
|
109
|
+
try {
|
|
110
|
+
this._pipe.setInterpolationStrategyParams(this._pendingInterpolationStrategyParams);
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
console.info(`${this.processorLabel} Failed to update interpolation strategy params.`);
|
|
114
|
+
}
|
|
115
|
+
this._pendingInterpolationStrategyParams = null;
|
|
116
|
+
}
|
|
117
|
+
if (this._pendingStretchParameters !== null) {
|
|
118
|
+
try {
|
|
119
|
+
this._pipe.setStretchParameters(this._pendingStretchParameters);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
console.info(`${this.processorLabel} Failed to update stretch parameters.`);
|
|
123
|
+
}
|
|
124
|
+
this._pendingStretchParameters = null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Optional hook called after input routing and buffer resize but **before**
|
|
129
|
+
* the SoundTouch pipe processes the block.
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* Override in subclasses that need to inspect or transform the raw input
|
|
133
|
+
* before it enters the DSP pipeline (e.g. computing LPC coefficients).
|
|
134
|
+
*
|
|
135
|
+
* @param _leftInput - Left-channel input for this render block.
|
|
136
|
+
* @param _rightInput - Right-channel input (same as left for mono sources).
|
|
137
|
+
* @param _frameCount - Number of frames in this block.
|
|
138
|
+
* @param _parameters - AudioParam k-rate values for this render block.
|
|
139
|
+
*/
|
|
140
|
+
beforePipeProcess(_leftInput, _rightInput, _frameCount, _parameters) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Extracts rendered frames from the output buffer, writes them to
|
|
145
|
+
* `leftOutput`/`rightOutput`, zero-fills any gap, and returns RMS/peak metrics.
|
|
146
|
+
*
|
|
147
|
+
* @remarks
|
|
148
|
+
* Override in subclasses that apply post-extraction transforms (e.g. formant
|
|
149
|
+
* correction). Overrides are responsible for the full extraction, write-back,
|
|
150
|
+
* silence fill, and returning `{ outputRms, outputPeak }`.
|
|
151
|
+
*
|
|
152
|
+
* @param leftOutput - Destination view for the left channel.
|
|
153
|
+
* @param rightOutput - Destination view for the right channel.
|
|
154
|
+
* @param frameCount - Total frames expected in this block.
|
|
155
|
+
* @param toExtract - Frames available to extract (≤ frameCount).
|
|
156
|
+
* @param _parameters - AudioParam k-rate values (available for overrides).
|
|
157
|
+
* @returns RMS and peak of the extracted block.
|
|
158
|
+
*/
|
|
159
|
+
extractSamples(leftOutput, rightOutput, frameCount, toExtract, _parameters) {
|
|
160
|
+
let outputRms = 0;
|
|
161
|
+
let outputPeak = 0;
|
|
162
|
+
if (toExtract > 0) {
|
|
163
|
+
const extracted = this._outputSamples;
|
|
164
|
+
this._pipe.outputBuffer.extract(extracted, 0, toExtract);
|
|
165
|
+
this._pipe.outputBuffer.receive(toExtract);
|
|
166
|
+
let sumSq = 0;
|
|
167
|
+
let peak = 0;
|
|
168
|
+
for (let i = 0; i < toExtract; i++) {
|
|
169
|
+
const l = extracted[i * 2];
|
|
170
|
+
const r = extracted[i * 2 + 1];
|
|
171
|
+
leftOutput[i] = Number.isFinite(l) ? l : 0;
|
|
172
|
+
rightOutput[i] = Number.isFinite(r) ? r : 0;
|
|
173
|
+
sumSq += l * l + r * r;
|
|
174
|
+
peak = Math.max(peak, Math.abs(l), Math.abs(r));
|
|
175
|
+
}
|
|
176
|
+
outputRms = Math.sqrt(sumSq / (toExtract * 2));
|
|
177
|
+
outputPeak = peak;
|
|
178
|
+
}
|
|
179
|
+
for (let i = toExtract; i < frameCount; i++) {
|
|
180
|
+
leftOutput[i] = 0;
|
|
181
|
+
rightOutput[i] = 0;
|
|
182
|
+
}
|
|
183
|
+
return { outputRms, outputPeak };
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Runs the full DSP pipeline for one render block and returns metrics.
|
|
187
|
+
*
|
|
188
|
+
* @remarks
|
|
189
|
+
* Handles input routing, buffer resize, `beforePipeProcess`, pitch
|
|
190
|
+
* calculation, sample interleaving, pipe feed/process, counter updates,
|
|
191
|
+
* and `extractSamples`. Returns `null` when the input is empty or
|
|
192
|
+
* the output has not been allocated, keeping the processor alive.
|
|
193
|
+
*
|
|
194
|
+
* @param inputs - AudioWorklet input buses.
|
|
195
|
+
* @param outputs - AudioWorklet output buses.
|
|
196
|
+
* @param parameters - k-rate AudioParam values.
|
|
197
|
+
* @returns Render-block result, or `null` if inputs are not ready.
|
|
198
|
+
*/
|
|
199
|
+
processCore(inputs, outputs, parameters) {
|
|
200
|
+
const input = inputs[0];
|
|
201
|
+
const output = outputs[0];
|
|
202
|
+
if (!input || !input.length || !output[0] || !output[0].length) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
const leftInput = input[0];
|
|
206
|
+
// Mono input: duplicate the single channel to both sides of the stereo pipeline.
|
|
207
|
+
const rightInput = input.length > 1 ? input[1] : input[0];
|
|
208
|
+
const leftOutput = output[0];
|
|
209
|
+
// Mono output (outputChannelCount: 1): both channels write to the same array.
|
|
210
|
+
const rightOutput = output.length > 1 ? output[1] : output[0];
|
|
211
|
+
const frameCount = leftInput.length;
|
|
212
|
+
if (this._samples.length < frameCount * 2) {
|
|
213
|
+
this._samples = new Float32Array(frameCount * 2);
|
|
214
|
+
this._outputSamples = new Float32Array(frameCount * 2);
|
|
215
|
+
}
|
|
216
|
+
this.beforePipeProcess(leftInput, rightInput, frameCount, parameters);
|
|
217
|
+
const pitch = parameters['pitch'][0];
|
|
218
|
+
const pitchSemitones = parameters['pitchSemitones'][0];
|
|
219
|
+
const playbackRate = parameters['playbackRate'][0];
|
|
220
|
+
this._pipe.pitch =
|
|
221
|
+
(pitch * Math.pow(2, pitchSemitones / 12)) / playbackRate;
|
|
222
|
+
const samples = this._samples;
|
|
223
|
+
for (let i = 0; i < frameCount; i++) {
|
|
224
|
+
samples[i * 2] = leftInput[i];
|
|
225
|
+
samples[i * 2 + 1] = rightInput[i];
|
|
226
|
+
}
|
|
227
|
+
this._pipe.inputBuffer.putSamples(samples, 0, frameCount);
|
|
228
|
+
this._pipe.process();
|
|
229
|
+
const outputBuffer = this._pipe.outputBuffer;
|
|
230
|
+
const available = outputBuffer.frameCount;
|
|
231
|
+
const toExtract = Math.min(available, frameCount);
|
|
232
|
+
this._blockCount++;
|
|
233
|
+
if (available < frameCount) {
|
|
234
|
+
this._underrunCount++;
|
|
235
|
+
}
|
|
236
|
+
const { outputRms, outputPeak } = this.extractSamples(leftOutput, rightOutput, frameCount, toExtract, parameters);
|
|
237
|
+
return {
|
|
238
|
+
frameCount,
|
|
239
|
+
toExtract,
|
|
240
|
+
available,
|
|
241
|
+
leftInput,
|
|
242
|
+
rightInput,
|
|
243
|
+
leftOutput,
|
|
244
|
+
rightOutput,
|
|
245
|
+
outputRms,
|
|
246
|
+
outputPeak,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* AudioWorkletProcessor render callback. Keeps the processor alive by always returning `true`.
|
|
251
|
+
*
|
|
252
|
+
* @remarks
|
|
253
|
+
* The default implementation calls `applyPendingRuntimeUpdates`, `processCore`,
|
|
254
|
+
* and `onProcessComplete`. Override only when the execution order must differ
|
|
255
|
+
* (e.g. pre-pipe analysis steps not covered by `beforePipeProcess`).
|
|
256
|
+
*
|
|
257
|
+
* @param inputs - AudioWorklet input buses.
|
|
258
|
+
* @param outputs - AudioWorklet output buses.
|
|
259
|
+
* @param parameters - k-rate AudioParam values.
|
|
260
|
+
* @returns Always `true` to keep the processor alive.
|
|
261
|
+
*/
|
|
262
|
+
process(inputs, outputs, parameters) {
|
|
263
|
+
this.applyPendingRuntimeUpdates();
|
|
264
|
+
const result = this.processCore(inputs, outputs, parameters);
|
|
265
|
+
if (result !== null) {
|
|
266
|
+
this.onProcessComplete(result);
|
|
267
|
+
}
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=SoundTouchProcessorBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoundTouchProcessorBase.js","sourceRoot":"","sources":["../src/SoundTouchProcessorBase.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAS9E;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,uBAAwB,SAAQ,qBAAqB;IACzE,4CAA4C;IAClC,KAAK,CAAa;IAC5B,wDAAwD;IAC9C,QAAQ,CAAe;IACjC,uEAAuE;IAC7D,cAAc,CAAe;IACvC,2EAA2E;IACjE,cAAc,GAAG,CAAC,CAAC;IAC7B,wDAAwD;IAC9C,WAAW,GAAG,CAAC,CAAC;IAElB,6BAA6B,GACnC,IAAI,CAAC;IACC,mCAAmC,GACzC,IAAI,CAAC;IACC,yBAAyB,GAA6B,IAAI,CAAC;IAEnE,uEAAuE;IACpD,cAAc,CAAS;IAE1C;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,eAAe,CAC3B,QAAyD,EACzD,cAAsB;QAEtB,IAAI,CAAC;YACH,IAAI,QAAQ,EAAE,CAAC;gBACb,4BAA4B,CAAC,QAAQ,CAAC,CAAC;YACzC,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,IAAI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C;YAC3B,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,CAAC;QAED,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,cAAc,CACnD,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,CACX,CAAC;QAEF,OAAO;YACL,UAAU;YACV,SAAS;YACT,SAAS;YACT,SAAS;YACT,UAAU;YACV,UAAU;YACV,WAAW;YACX,SAAS;YACT,UAAU;SACX,CAAC;IACJ,CAAC;IAaD;;;;;;;;;;;;OAYG;IACH,OAAO,CACL,MAAwB,EACxB,OAAyB,EACzB,UAAwC;QAExC,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC7D,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/.dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SoundTouchProcessorBase } from './SoundTouchProcessorBase.js';
|
|
2
|
+
export { STANDARD_PARAMETER_DESCRIPTORS } from './types.js';
|
|
3
|
+
export type { ParameterDescriptor, ProcessCoreResult, ProcessorMessage, SetInterpolationStrategyMessage, SetInterpolationStrategyParamsMessage, SetStretchParametersMessage, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAC5D,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,+BAA+B,EAC/B,qCAAqC,EACrC,2BAA2B,GAC5B,MAAM,YAAY,CAAC"}
|
package/.dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.float16.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../core/.dist/SampleBuffer.d.ts","../../core/.dist/AbstractSamplePipe.d.ts","../../core/.dist/CircularSampleBuffer.d.ts","../../core/.dist/FifoSampleBuffer.d.ts","../../core/.dist/SampleBufferAdapter.d.ts","../../core/.dist/interpolationStrategyRegistry.d.ts","../../core/.dist/RateTransposer.d.ts","../../core/.dist/StretchPipe.d.ts","../../core/.dist/Stretch.d.ts","../../core/.dist/SoundTouch.d.ts","../../core/.dist/index.d.ts","../src/types.ts","../src/SoundTouchProcessorBase.ts","../src/index.ts","../src/worklet-globals.d.ts"],"fileIdsList":[[88],[88,89,92,93],[88,93,94,95,96],[88,89,95],[88,96],[88,89,90,91,93,94,95,96,97],[98,99],[99,100],[98]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},"031762d237c1ac353656a5d222e7ac098c7efd01b575a6f808715a6705b8e05d","a9c6ed4c0ed7eaf0653b59f8e75d928ec97eb7ece708844ba8ccfd4cbbb0a29b","feb8476d9e3c03d131e62e02693ed9ae61150a4ef966d44c620fd157135d8a40","36b0d32b0d99125f1ecb3d435c90052592301a60559e4e6a1c9e62af4d9c5771","fcf4c1601baee1fa0fe5b2e6f08d2c8fd1be9e8a1ae31c7618281b08e20b3a9f","c832fde4d16500f0fe9beb03d28457ac5fc90a0bf69519190bbb04bf54ee72a7","c6ab60a2209f4909a7bab704afa46c7b81a0e936e7facc5390a7f6e898112537","3cf5981676e451c4d157a86489e90d9b9ff86cd216957f0165308e7893dcce7f","72b787253407fe680a96bc269b2acd35fc1fa5bc85f4d434a15837bde76b239a","8232c1d12713ccbe359625ecdee3a6239a95082ec29b9bfd4272aacdb253b8bc","6cf335761157f5b9f12af976d62b83ad657371e60bed4f8aa41ed986e534287d",{"version":"331acf7986e4fbae43de4878c296db4b5834c1d0e9c6ef72cc3e1ddf588bb7be","signature":"b228222fcbf413b04e8f5dda3a2a134f3167d43356bef1d76ee200317f9bbdb1"},{"version":"c3c5fe147d0a728ea83d359bfaee71c03e9c06b6a4e4807e83a97bf2261b2e8a","signature":"eed10d7d30d61b62070e9a33778e1c3f120dcb864b89b9f95dc97aa40d5f8777"},{"version":"ab701e3694efa066616920b2e948d579a1e9ab4b36d443cfc472a2d56ed83011","signature":"0693106c65a4d66c1c44927d6ea7f2771494e1e441a036e8c7e691cfbaf311fd"},{"version":"57d25e252ef65da61af3cbac812a0ee81544d5936e2dc40c8c226b19fe52323c","affectsGlobalScope":true}],"root":[[99,102]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":99,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":11,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"referencedMap":[[89,1],[90,1],[94,2],[92,1],[97,3],[96,4],[95,5],[98,6],[100,7],[101,8],[99,9]],"latestChangedDtsFile":"./index.d.ts","version":"6.0.3"}
|
package/.dist/types.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { InterpolationStrategyParams, RateTransposerInterpolationStrategy, StretchParameters } from '@soundtouchjs/core';
|
|
2
|
+
/** AudioParam descriptor shape expected by the worklet runtime. */
|
|
3
|
+
export interface ParameterDescriptor {
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue: number;
|
|
6
|
+
minValue: number;
|
|
7
|
+
maxValue: number;
|
|
8
|
+
automationRate: 'k-rate' | 'a-rate';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Standard pitch, pitchSemitones, and playbackRate AudioParam descriptors
|
|
12
|
+
* shared by all SoundTouchJS worklet processors.
|
|
13
|
+
*/
|
|
14
|
+
export declare const STANDARD_PARAMETER_DESCRIPTORS: ParameterDescriptor[];
|
|
15
|
+
export interface SetInterpolationStrategyMessage {
|
|
16
|
+
type: 'set-interpolation-strategy';
|
|
17
|
+
strategy: RateTransposerInterpolationStrategy;
|
|
18
|
+
}
|
|
19
|
+
export interface SetInterpolationStrategyParamsMessage {
|
|
20
|
+
type: 'set-interpolation-strategy-params';
|
|
21
|
+
params: Partial<InterpolationStrategyParams>;
|
|
22
|
+
}
|
|
23
|
+
export interface SetStretchParametersMessage {
|
|
24
|
+
type: 'set-stretch-parameters';
|
|
25
|
+
params: StretchParameters;
|
|
26
|
+
}
|
|
27
|
+
export type ProcessorMessage = SetInterpolationStrategyMessage | SetInterpolationStrategyParamsMessage | SetStretchParametersMessage;
|
|
28
|
+
/**
|
|
29
|
+
* Data returned by {@link SoundTouchProcessorBase.processCore} after a render block.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Contains routing arrays (for post-extraction overrides), counters, and the
|
|
33
|
+
* RMS/peak values computed during extraction. Subclasses that override
|
|
34
|
+
* `extractSamples` may return `outputRms: 0, outputPeak: 0` when they do not
|
|
35
|
+
* compute those metrics.
|
|
36
|
+
*/
|
|
37
|
+
export interface ProcessCoreResult {
|
|
38
|
+
/** Number of frames in this render block. */
|
|
39
|
+
frameCount: number;
|
|
40
|
+
/** Number of frames extracted from the output buffer (≤ frameCount). */
|
|
41
|
+
toExtract: number;
|
|
42
|
+
/** Frames available in the output buffer before extraction. */
|
|
43
|
+
available: number;
|
|
44
|
+
/** Left-channel input view for this render block. */
|
|
45
|
+
leftInput: Float32Array;
|
|
46
|
+
/** Right-channel input view (same as leftInput for mono sources). */
|
|
47
|
+
rightInput: Float32Array;
|
|
48
|
+
/** Left-channel output view written during extraction. */
|
|
49
|
+
leftOutput: Float32Array;
|
|
50
|
+
/** Right-channel output view written during extraction. */
|
|
51
|
+
rightOutput: Float32Array;
|
|
52
|
+
/** RMS of the extracted block (both channels, 0 if not computed). */
|
|
53
|
+
outputRms: number;
|
|
54
|
+
/** Peak amplitude of the extracted block (0 if not computed). */
|
|
55
|
+
outputPeak: number;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,mCAAmC,EACnC,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAE5B,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACrC;AAED;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,mBAAmB,EAsB/D,CAAC;AAEF,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,4BAA4B,CAAC;IACnC,QAAQ,EAAE,mCAAmC,CAAC;CAC/C;AAED,MAAM,WAAW,qCAAqC;IACpD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,MAAM,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,wBAAwB,CAAC;IAC/B,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,MAAM,MAAM,gBAAgB,GACxB,+BAA+B,GAC/B,qCAAqC,GACrC,2BAA2B,CAAC;AAEhC;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,EAAE,YAAY,CAAC;IACxB,qEAAqE;IACrE,UAAU,EAAE,YAAY,CAAC;IACzB,0DAA0D;IAC1D,UAAU,EAAE,YAAY,CAAC;IACzB,2DAA2D;IAC3D,WAAW,EAAE,YAAY,CAAC;IAC1B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/.dist/types.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard pitch, pitchSemitones, and playbackRate AudioParam descriptors
|
|
3
|
+
* shared by all SoundTouchJS worklet processors.
|
|
4
|
+
*/
|
|
5
|
+
export const STANDARD_PARAMETER_DESCRIPTORS = [
|
|
6
|
+
{
|
|
7
|
+
name: 'pitch',
|
|
8
|
+
defaultValue: 1.0,
|
|
9
|
+
minValue: 0.1,
|
|
10
|
+
maxValue: 8.0,
|
|
11
|
+
automationRate: 'k-rate',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'pitchSemitones',
|
|
15
|
+
defaultValue: 0,
|
|
16
|
+
minValue: -24,
|
|
17
|
+
maxValue: 24,
|
|
18
|
+
automationRate: 'k-rate',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'playbackRate',
|
|
22
|
+
defaultValue: 1.0,
|
|
23
|
+
minValue: 0.1,
|
|
24
|
+
maxValue: 8.0,
|
|
25
|
+
automationRate: 'k-rate',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAA0B;IACnE;QACE,IAAI,EAAE,OAAO;QACb,YAAY,EAAE,GAAG;QACjB,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,GAAG;QACb,cAAc,EAAE,QAAQ;KACzB;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,CAAC,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,cAAc,EAAE,QAAQ;KACzB;IACD;QACE,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,GAAG;QACjB,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,GAAG;QACb,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC"}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Mozilla Public License Version 2.0
|
|
2
|
+
|
|
3
|
+
This package is licensed under the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
+
|
|
5
|
+
Full license text: https://www.mozilla.org/en-US/MPL/2.0/
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# @soundtouchjs/worklet-base
|
|
2
|
+
|
|
3
|
+
Abstract base class for SoundTouchJS AudioWorklet processor packages. Centralises the shared DSP pipeline, runtime-update queue, and sample-buffer management that would otherwise be duplicated across every processor implementation.
|
|
4
|
+
|
|
5
|
+
[I accept cash](https://paypal.me/cutterbl?locale.x=en_US) if you like what's been done.
|
|
6
|
+
|
|
7
|
+
Part of the [SoundTouchJS](https://github.com/cutterbl/SoundTouchJS) monorepo — for more information and so much more.
|
|
8
|
+
|
|
9
|
+
## Who this package is for
|
|
10
|
+
|
|
11
|
+
This package is an **implementation detail** of the SoundTouchJS worklet packages (`@soundtouchjs/audio-worklet`, `@soundtouchjs/phase-vocoder-worklet`, `@soundtouchjs/formant-correction-worklet`). It is also the correct starting point if you want to build a **custom AudioWorklet processor** on top of the SoundTouch engine.
|
|
12
|
+
|
|
13
|
+
If you only want to use SoundTouchJS in a web app, install one of the worklet packages above — you do not need to install this package directly.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install @soundtouchjs/worklet-base
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Extend `SoundTouchProcessorBase` inside your processor module and implement the required `onProcessComplete` hook:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { SoundTouchProcessorBase, STANDARD_PARAMETER_DESCRIPTORS } from '@soundtouchjs/worklet-base';
|
|
27
|
+
import type { ProcessCoreResult } from '@soundtouchjs/worklet-base';
|
|
28
|
+
|
|
29
|
+
class MyProcessor extends SoundTouchProcessorBase {
|
|
30
|
+
static get parameterDescriptors() {
|
|
31
|
+
return STANDARD_PARAMETER_DESCRIPTORS;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
super('[MyProcessor]', {});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onProcessComplete(result: ProcessCoreResult): void {
|
|
39
|
+
// called after each block; post metrics, trigger side-effects, etc.
|
|
40
|
+
this.port.postMessage({ type: 'metrics', ...result });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
registerProcessor('my-processor', MyProcessor);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Optional hooks
|
|
48
|
+
|
|
49
|
+
| Method | When to override |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `beforePipeProcess(left, right, frameCount, params)` | Pre-pipe analysis (e.g. LPC analysis for formant correction). Default is a no-op. |
|
|
52
|
+
| `extractSamples(leftOutput, rightOutput, frameCount)` | Full extraction/write-back override (e.g. formant synthesis). Default writes both channels and returns RMS/peak metrics. |
|
|
53
|
+
|
|
54
|
+
### Runtime messages
|
|
55
|
+
|
|
56
|
+
Send messages to the processor via `AudioWorkletNode.port.postMessage`:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
// Change interpolation strategy
|
|
60
|
+
node.port.postMessage({ type: 'setInterpolationStrategy', value: 'lanczos' });
|
|
61
|
+
|
|
62
|
+
// Update strategy parameters
|
|
63
|
+
node.port.postMessage({ type: 'setInterpolationStrategyParams', value: { ... } });
|
|
64
|
+
|
|
65
|
+
// Update stretch parameters
|
|
66
|
+
node.port.postMessage({ type: 'setStretchParameters', value: { ... } });
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## API
|
|
70
|
+
|
|
71
|
+
### `SoundTouchProcessorBase`
|
|
72
|
+
|
|
73
|
+
Abstract class extending `AudioWorkletProcessor`.
|
|
74
|
+
|
|
75
|
+
#### Constructor
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
new SoundTouchProcessorBase(processorLabel: string, pipeOptions: SoundTouchOptions)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| Parameter | Description |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `processorLabel` | Label used in log messages (e.g. `'[MyProcessor]'`). |
|
|
84
|
+
| `pipeOptions` | Options forwarded to `SoundTouch` (interpolation strategy, stretch parameters, etc.). |
|
|
85
|
+
|
|
86
|
+
#### Abstract method
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
abstract onProcessComplete(result: ProcessCoreResult): void
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Called at the end of every successfully processed block. `result` contains `{ outputRms, outputPeak }` unless `extractSamples` is overridden to return different values.
|
|
93
|
+
|
|
94
|
+
#### Static method
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
static resolveStrategy(
|
|
98
|
+
id: RateTransposerInterpolationStrategy | undefined,
|
|
99
|
+
label: string,
|
|
100
|
+
): RateTransposerInterpolationStrategy | undefined
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Validates an interpolation strategy ID against the registry. Falls back to `'lanczos'` and logs a warning for unknown IDs.
|
|
104
|
+
|
|
105
|
+
### `STANDARD_PARAMETER_DESCRIPTORS`
|
|
106
|
+
|
|
107
|
+
Array of `AudioParamDescriptor` objects for the three standard k-rate parameters: `pitch`, `pitchSemitones`, and `playbackRate`. Spread this into your `parameterDescriptors` getter.
|
|
108
|
+
|
|
109
|
+
### Message types
|
|
110
|
+
|
|
111
|
+
| Export | Description |
|
|
112
|
+
|---|---|
|
|
113
|
+
| `SetInterpolationStrategyMessage` | `{ type: 'setInterpolationStrategy', value: RateTransposerInterpolationStrategy }` |
|
|
114
|
+
| `SetInterpolationStrategyParamsMessage` | `{ type: 'setInterpolationStrategyParams', value: InterpolationStrategyParams }` |
|
|
115
|
+
| `SetStretchParametersMessage` | `{ type: 'setStretchParameters', value: StretchParameters }` |
|
|
116
|
+
| `ProcessorMessage` | Union of the three message types above. |
|
|
117
|
+
| `ProcessCoreResult` | `{ outputRms: number, outputPeak: number }` |
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
[MPL-2.0](./LICENSE)
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@soundtouchjs/worklet-base",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Abstract base processor for SoundTouchJS AudioWorklet packages",
|
|
5
|
+
"license": "MPL-2.0",
|
|
6
|
+
"licenseFile": "LICENSE",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./.dist/index.d.ts",
|
|
13
|
+
"default": "./.dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"main": "./.dist/index.js",
|
|
17
|
+
"types": "./.dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
".dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"audio",
|
|
25
|
+
"WebAudio",
|
|
26
|
+
"AudioWorklet",
|
|
27
|
+
"TypeScript",
|
|
28
|
+
"pitch",
|
|
29
|
+
"tempo",
|
|
30
|
+
"soundtouch"
|
|
31
|
+
],
|
|
32
|
+
"author": "Steve 'Cutter' Blades",
|
|
33
|
+
"contributors": [
|
|
34
|
+
"Steve 'Cutter' Blades <web.admin@cutterscrossing.com> (https://cutterscrossing.com/)"
|
|
35
|
+
],
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/cutterbl/SoundTouchJS.git",
|
|
39
|
+
"directory": "packages/worklet-base"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/cutterbl/SoundTouchJS/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/cutterbl/SoundTouchJS",
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@soundtouchjs/core": "2.0.1"
|
|
50
|
+
}
|
|
51
|
+
}
|