Coerces an unknown value into a finite number, falling back to a default when validation fails.
function CoerceFiniteNumber(value: unknown, fallback: number): number;
The CoerceFiniteNumber() function ensures that a usable finite numeric value is always returned.
It internally validates the provided value using IsFiniteNumber() and:
This helper is especially useful for sanitizing external input, user-provided parameters, or messages received from AudioWorklet nodes before applying them to DSP logic.
value: unknown – The value to validate and coerce.fallback: number – The fallback value to return if validation fails.number – A guaranteed finite numeric value.This function does not emit any errors or warnings.