npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@waveform-playlist/worklets

v13.0.0

Published

AudioWorklet processors for waveform-playlist (metering, recording)

Readme

@waveform-playlist/worklets

AudioWorklet processors for waveform-playlist — metering (VU) and recording capture.

Used by @waveform-playlist/recording, @waveform-playlist/browser (output metering), and the dawcore recording controller.

Features

  • Recording processor — captures microphone/input audio in the audio rendering thread, with transferable-buffer flushes for low-overhead delivery to the main thread
  • Metering processor — computes peak/RMS levels per channel for VU meters
  • Context-agnostic loading — a callback-injection loader works with a native AudioContext or a Tone.js (standardized-audio-context) context, so you decide how addModule is called

Installation

npm install @waveform-playlist/worklets

Usage

Register the worklet module on your AudioContext before creating the corresponding AudioWorkletNode. Pass in your own addModule call — this works whether the context is a native AudioContext or a Tone.js context:

import { addRecordingWorkletModule } from '@waveform-playlist/worklets';

// Native AudioContext
const ctx = new AudioContext();
await addRecordingWorkletModule((url) => ctx.audioWorklet.addModule(url));

// Tone.js context (standardized-audio-context)
const rawCtx = context.rawContext;
await addRecordingWorkletModule((url) => rawCtx.audioWorklet.addModule(url));

const recorderNode = new AudioWorkletNode(ctx, 'recording-processor');

Metering follows the same pattern:

import { addMeterWorkletModule, type MeterMessage } from '@waveform-playlist/worklets';

await addMeterWorkletModule((url) => ctx.audioWorklet.addModule(url));

const meterNode = new AudioWorkletNode(ctx, 'meter-processor');
meterNode.port.onmessage = (event: MessageEvent<MeterMessage>) => {
  // A single Float32Array of length 2*N (N = channel count):
  // indices [0..N-1] are per-channel peak, [N..2N-1] are per-channel RMS.
  // The worklet reuses one buffer (zero allocation on the audio thread);
  // each message is a structured-clone copy.
  const data = event.data;
  const channels = data.length / 2;
  for (let ch = 0; ch < channels; ch++) {
    updateVuMeter(ch, data[ch], data[channels + ch]); // peak, rms
  }
};

API

  • addRecordingWorkletModule(addModule: (url: string) => Promise<void>): Promise<void> — registers the recording-processor worklet module via your context's addModule callback
  • addMeterWorkletModule(addModule: (url: string) => Promise<void>): Promise<void> — registers the meter-processor worklet module via your context's addModule callback
  • recordingProcessorUrl / meterProcessorUrl — the underlying module URLs, for consumers who want to call audioWorklet.addModule() directly instead of using the loaders
  • MeterMessage — a Float32Array of length 2*N (N = channel count) posted by the meter-processor: [0..N-1] per-channel peak, [N..2N-1] per-channel RMS. Derive the channel count as data.length / 2

Examples & Documentation

License

MIT