Scan your whole stack
Are you using @onda-lang/webaudio?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.9.3
@onda-lang/webaudio was last scanned on 24 Nov 2026 at version 0.9.3. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.9.3 LATEST | 24 Nov 2026 | No rules fired |
| 0.9.2 | 12 Nov 2026 | No rules fired |
| 0.9.1 | 11 Nov 2026 | No rules fired |
| 0.9.0 | 10 Nov 2026 | Not shown |
| 0.8.40 | 24 Oct 2026 | Not shown |
Findings for v0.9.3. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.9.3; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
See api.md for the complete public Web API shared with the released package.
This optional package hosts a complete wasm32 Onda processor artifact in an AudioWorklet. It is a
reference adapter for the generic Onda processor ABI; Web Audio is not required by the compiler or
by native and relocatable-WebAssembly object consumers.
import {
createOndaAudioProcessorInitialized,
ONDA_INIT_FULL,
ONDA_INIT_PRESERVE_PINNED,
} from "@onda-lang/webaudio";
const processor = await createOndaAudioProcessorInitialized(audioContext, artifact, {
params: { gain: 0.5 },
buffers: {},
});
processor.node.connect(audioContext.destination);
await processor.setParam("gain", 0.75);
await processor.setParamNormalized("cutoff", 0.5);
const snapshot = await processor.snapshot();
await processor.init(ONDA_INIT_PRESERVE_PINNED);
await processor.init(ONDA_INIT_FULL);
The adapter registers onda-wasm-processor, derives Web Audio channel options from artifact
metadata, marshals declared scalar widths, schedules arbitrary render quanta across Onda compile
blocks, and provides request/response helpers for parameters, events, buffers, control outputs,
initialization, and portable snapshots.
createOndaAudioProcessor() is allocation-only. This lets a host configure parameters before the
first initializer run:
const processor = await createOndaAudioProcessor(audioContext, artifact);
await processor.setParam("gain", 0.75);
await processor.init(ONDA_INIT_FULL);
Until full initialization succeeds, the worklet emits silence and rejects stateful control operations. Successful initialization switches it to the initialized process callback, so the steady-state audio callback does not retain a lifecycle branch.
params passed during construction and values passed to setParam() are plain Onda values. The
adapter clamps ranged scalar values and snaps stepped domains before posting them; the real-time
worklet only writes the resulting canonical value in the declared scalar representation. Unknown
initial parameter names or indices are rejected before the worklet node is constructed.
The optional host setting paramSmoothingSeconds defaults to 0. A positive value applies finite
linear ramps to continuous float parameters and array elements. Values advance once per logical
block, independently of Web Audio callback sizes; durations at most one block are bypassed.
Integer, boolean, and stepped controls update directly. Initial parameters and reinitialization
settle immediately. A new target restarts from the published value, while repeated writes of the
same target preserve its deadline. Host ramps are excluded from processor snapshots. The browser
playground defaults to 0.03 seconds (30 ms), with a live Smooth control in its Params header
that remembers the duration in the browser. Explicit DSP smoothing can interpolate within a block.
setParamSmoothingSeconds(seconds) changes the duration live without recompilation or
reinitialization. Active ramps restart from the current published value with the new duration.
Setting 0 (or a duration at most one block) settles active targets immediately and disables ramps;
smoothing can be enabled later. The duration must be finite and nonnegative, and affects continuous
float writes from UI controls and automation alike.
resetParams() restores all declared defaults immediately and cancels host ramps without resetting
DSP state.
setParamNormalized() accepts a host value in [0, 1]. The adapter uses the artifact descriptor's
linear or logarithmic scale and step metadata to convert it to a plain value before posting the
write to the worklet. Boolean normalized values use the 0.5 threshold. For example:
await processor.setParam("cutoff", 440); // exactly 440 Hz
await processor.setParamNormalized("cutoff", 0.5); // midpoint in its declared control scale
await processor.setParamElement("offsets", 1, 12); // one fixed-array element
await processor.setParamElementNormalized("offsets", 1, 0.5);
The element methods also accept scalar parameters with element index zero. Indexed names such as
offsets[1] remain available through setParam() and setParamNormalized().
The same synchronous conversion helpers are re-exported for UI display and typed entry:
import {
paramNormalizedToPlain,
paramPlainToNormalized,
} from "@onda-lang/webaudio";
const cutoff = processor.metadata.metadata.params.find(
(param) => param.name === "cutoff",
);
const displayValue = paramNormalizedToPlain(cutoff, sliderValue);
const sliderValueFor440Hz = paramPlainToNormalized(cutoff, 440);
The helpers preserve exact endpoints, clamp and snap consistently with adapter writes, and reject
numeric parameters without a host-control domain. Select array elements with indexed names such
as offsets[0], or supply an exact-length array to setParam("offsets", values). scale, curve, unit, step_repr,
and step_count remain available on each parameter's descriptor metadata for control construction
and formatting. For repeated UI conversion, createParamControl(param) prepares and validates the
descriptor once and returns bound conversion methods; pass an element index as its second argument
for an array.
Controlled i64 domains use the descriptor's exact binary64 integer range. Full-width unranged
i64 values continue to use bigint when written directly.
The artifact must be compiled for exactly audioContext.sampleRate; the adapter rejects a mismatch
before registering the node so sample-rate-derived language semantics cannot silently drift. A Web
Audio processor must expose at least one audio input or output, because an empty callback surface
does not carry a render-quantum frame count. Control-only artifacts remain usable through the generic
processor ABI in a non-Web-Audio host.
Call processor.close() when the adapter is no longer used. Closing is idempotent and terminal: it
rejects pending requests, removes listeners, and makes subsequent operations fail immediately. The
wrapped AudioWorkletNode and AudioContext remain caller-owned.
trigger(nameOrIndex, values?) accepts event parameters as an ordered array or an object keyed by
parameter name. Nominal structs are objects containing exactly their declared fields; tuples, fixed
arrays, and runtime slices are sequences. The adapter validates and encodes the complete logical
value on the main thread before transferring its packed bytes to the worklet.
For this Onda declaration:
struct Note:
frequency = 440.0
velocity = 1.0
init:
current_note: Note
event note_on(note: Note):
current_note = note
the corresponding host call is:
await processor.trigger("note_on", {
note: { frequency: 523.25, velocity: 0.7 },
});
Fixed arrays must have their declared length. Slice lengths may vary up to the configured event
payload capacity. i64 leaves accept bigint, exact safe integers, or decimal integer strings and
reject values outside the signed 64-bit range. Missing top-level arguments use declared defaults;
structs and struct arrays have no event defaults and must be supplied in full. Input rejected during
worklet preflight leaves processor state usable and rejects the returned promise. Unknown
nonnegative numeric event indices are successful no-ops, matching native dispatch; unknown names
and negative indices reject the promise.
Authored print(...) occurrences leave generated execution as bounded typed records. The worklet
copies those records into a preallocated SharedArrayBuffer ring without formatting or allocating
during audio rendering; the main-side adapter drains the ring and turns them into canonical,
newline-terminated text:
const processor = await createOndaAudioProcessorInitialized(context, artifact, {
printCapacityBytes: 128 * 1024,
// Register during construction to include output from authored init code.
onPrint: ({ text, entries, overflowCount, transportDropCount }) => {
logView.append(text);
if (overflowCount) console.warn(`${overflowCount} generated print records were dropped`);
if (transportDropCount) console.warn(`${transportDropCount} print records missed UI transport`);
},
});
text is ready to write or display and contains one newline-terminated line per occurrence.
entries retains typed values and source/log-site metadata for source-aware consumers. Generated
batch overflow and bounded worklet-to-main transport loss are reported separately; loss-only
notifications are delivered even when no later authored print arrives. Capacity defaults to 64 KiB
and can be set to zero to suppress host delivery without suppressing argument evaluation. Print
collection is inactive while no listener is registered, avoiding record packing and transport work
in the render callback. Listeners added later with processor.onPrint(...) receive subsequent
executions; use the construction option above when initialized-code output must be observed.
See the host output guide for scalar formatting,
source metadata, and the equivalent Rust, C, and raw processor APIs.
Top-level delegates are delivered after generated execution through onDelegates(). The worklet
uses reusable storage allocated during construction; listeners run while the main-side adapter
drains the shared ring, not as callbacks inside generated DSP code.
const processor = await createOndaAudioProcessorInitialized(context, artifact, {
delegateCapacityBytes: 128 * 1024,
});
const unsubscribe = processor.onDelegates(({
occurrences,
overflowCount,
transportDropCount,
}) => {
for (const occurrence of occurrences) {
console.log(occurrence.name, occurrence.values);
}
if (overflowCount) console.warn(`${overflowCount} delegate records were dropped`);
if (transportDropCount) {
console.warn(`${transportDropCount} delegate records were dropped in transport`);
}
});
Capacity defaults to 64 KiB and can be set to zero to disable host collection. It is a host policy,
not a compiler-computable exact whole-call size: occurrence counts and slice payload lengths may be
runtime-dependent. The worklet supplies delegate storage to generated code only while at least one
listener is registered, and decoding happens on the main side. overflowCount reports insufficient
configured capacity; transportDropCount separately reports records discarded by the bounded
worklet-to-main queue. Internal Onda when handlers still run in either case. See the
host output guide for sizing and lifecycle details.
When print and delegate listeners are both active, the adapter invokes them in authored order for each init, event, or process segment. It may split one stream's batch around an occurrence from the other stream; ordering intentionally does not span separate generated calls.
Print and delegate delivery requires SharedArrayBuffer. Browser deployments must therefore be
cross-origin isolated, normally with Cross-Origin-Opener-Policy: same-origin and
Cross-Origin-Embedder-Policy: require-corp (or credentialless). Audio processing remains usable
without those headers, but registering an output listener fails with a clear error.
Generated failures reject with OndaExecutionError.status; worklet validation and transport
failures reject with OndaRuntimeError.code from ONDA_RUNTIME_ERROR. Requested failures reject
only their promise. onExecutionError receives asynchronous render failures. Generated runtime
failures and unexpected Wasm traps invalidate the processor and silence later callbacks; full
initialization or snapshot restoration recovers it. Event input rejection preserves live state.
Rejected parameter arrays leave both storage and smoothing targets unchanged.
When shared memory is available, numeric statuses and acknowledgements use their own bounded
ring, independent of print/delegate capacity. Error objects and messages are created on the main
thread. Control requests use a bounded in-flight window with room for replies and render failures.
Without Atomics.waitAsync, control replies wake the adapter through the port; asynchronous render
failures are polled. Those control wakeups can incur browser cloning allocations.
A status transport overflow
silences the worklet, closes the adapter and rejects pending requests; recreate the processor.
Without shared memory, a reused numeric MessagePort packet provides the same error semantics,
although browser structured cloning may allocate.
createOndaAudioProcessor compiles the processor's WebAssembly.Module concurrently with worklet
registration, before constructing the AudioWorkletNode. The module is structured-cloned into the
worklet, so processor construction only instantiates it. Applications creating several instances can
compile once and reuse the module:
import {
compileOndaProcessorModule,
createOndaAudioProcessorInitialized,
} from "@onda-lang/webaudio";
const compiledModule = await compileOndaProcessorModule(artifact);
const left = await createOndaAudioProcessorInitialized(context, artifact, { compiledModule });
const right = await createOndaAudioProcessorInitialized(context, artifact, { compiledModule });
After construction, the normal f32 render callback reuses cached Wasm and shared-ring views and
performs no host-side allocation or memory growth, including while transporting print and delegate
records. Full-block f32 inputs and outputs use typed-array bulk copies;
segmented callbacks and other ABI scalar widths use preallocated typed views with conversion loops
(i64 input conversion necessarily creates JavaScript BigInt values). External buffers are copied
into Wasm with typed-array bulk operations during construction. Missing or null bindings install
neutral one-frame descriptors: reads return zero, writes are discarded, exact channel counts are
retained, and dynamic-channel buffers report one channel. Supplied bindings must still contain
nonempty, correctly shaped data.
Fixed buffer arrays may be supplied under their logical group name. Each slot is independent:
const processor = await createOndaAudioProcessorInitialized(context, artifact, {
buffers: {
impulse: { data: impulseSamples, channels: 1, sampleRate: 48_000 },
bank: [
null,
{ data: secondSamples, channels: 1, sampleRate: 48_000 },
// Remaining slots are neutral.
],
},
});
Hosts may instead pass a flat array in physical descriptor order or key individual physical names
such as "bank[1]". Logical group metadata determines the contiguous slot range; no sample data is
copied when Onda selects a slot while processing. Initial descriptors are installed before the
initialized factory awaits full initialization, so authored top-level and proc init code can
preprocess the supplied samples once before rendering begins.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.