Offload some more waveform processing onto a worker (#9223)
This commit is contained in:
parent
ca25c8f430
commit
e1f7b0af2c
15 changed files with 231 additions and 72 deletions
|
@ -57,6 +57,7 @@ export function arrayFastResample(input: number[], points: number): number[] {
|
|||
* @param {number} points The number of samples to end up with.
|
||||
* @returns {number[]} The resampled array.
|
||||
*/
|
||||
// ts-prune-ignore-next
|
||||
export function arraySmoothingResample(input: number[], points: number): number[] {
|
||||
if (input.length === points) return input; // short-circuit a complicated call
|
||||
|
||||
|
@ -99,6 +100,7 @@ export function arraySmoothingResample(input: number[], points: number): number[
|
|||
* @param {number} newMax The maximum value to scale to.
|
||||
* @returns {number[]} The rescaled array.
|
||||
*/
|
||||
// ts-prune-ignore-next
|
||||
export function arrayRescale(input: number[], newMin: number, newMax: number): number[] {
|
||||
const min: number = Math.min(...input);
|
||||
const max: number = Math.max(...input);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue