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

@hamstudy/mt63-audio-worklet

v2.0.0

Published

An npm module for the MT63 audio worklet.

Readme

MT63 Audio Worklet

The MT63 Audio Worklet is an npm module that provides an implementation of the MT63 audio processing algorithm using the Web Audio API. This module allows you to integrate MT63 audio processing into your web applications.

Installation

To install the MT63 Audio Worklet, use npm:

npm install @hamstudy/mt63-audio-worklet

Usage

To use the MT63 Audio Worklet in your application, follow these steps:

  1. Import the module in your JavaScript or TypeScript file:

    import { createMT63AudioNode } from '@hamstudy/mt63-audio-worklet';
  2. Load the WASM binary using @hamstudy/mt63-wasm:

    The MT63 Audio Worklet relies on the @hamstudy/mt63-wasm library to provide the core MT63 processing functionality. The WASM binary is loaded and initialized as follows:

    import { setFileLocation, initialize, MT63Client, wasmModule } from '@hamstudy/mt63-wasm';
    import wasmFile from '@hamstudy/mt63-wasm/dist/mt63Wasm.wasm';
    
    // Fetch the WASM binary
    const wasmBinary = fetch(wasmFile)
      .then(response => {
        if (!response.ok) {
          throw new Error(`Failed to fetch WASM file: ${response.statusText}`);
        }
        return response.arrayBuffer();
      })
      .then(buffer => new Uint8Array(buffer))
      .catch(err => {
        alert("Could not load MT63 library.");
        console.warn("Failed to load mt63 wasm file:", err);
      });
    
    // Set the file location for the WASM module
    setFileLocation("mt63Wasm.wasm", wasmFile);
    
    // Initialize the WASM module
    const readyDfd = wasmBinary.then(binary =>
      initialize(mod => {
        mod.wasmBinary = binary;
        return mod;
      })
    );
    
    export { MT63Client, wasmModule, wasmBinary, readyDfd };
  3. Create and register the audio worklet in your audio context:

    const audioContext = new AudioContext();
    const stream = await navigator.mediaDevices.getUserMedia({
      audio: {
        echoCancellation: { exact: false },
        noiseSuppression: { exact: false },
        channelCount: { exact: 1 },
        sampleRate: { ideal: 8000 },
        sampleSize: 16,
      },
    });
    const mt63Node = await createMT63AudioNode(audioContext, stream);
  4. Handle messages from the worklet:

    mt63Node.port.addEventListener('message', async (e) => {
      if (e.data.req === 'startup') {
        const binary = await wasmBinary; // Load the WASM binary
        mt63Node.port.postMessage({ binary });
      } else if (e.data.decoded) {
        console.log('Decoded data:', e.data.decoded);
      } else if (e.data.audioBuffer) {
        const audioData = e.data.audioBuffer;
        const sampleRate = e.data.sampleRate;
        console.log('Audio buffer received:', audioData, 'Sample rate:', sampleRate);
      }
    });
  5. Connect the worklet to your audio graph and handle stream lifecycle events:

    mt63Node.connect(audioContext.destination);
    
    stream.addEventListener('inactive', () => {
      console.log('Stream inactive, shutting down worklet');
      mt63Node.port.postMessage({ req: 'shutdown' });
    }, { once: true });

API

The MT63 Audio Worklet exposes the following methods:

  • createMT63AudioNode(audioContext: AudioContext, mediaStream: MediaStream): Creates and registers the MT63 audio worklet, returning an instance of MT63AudioWorkletNode.

  • MT63AudioWorkletNode: A custom AudioWorkletNode that handles MT63 audio processing. You can use its port to send and receive messages for additional control and data exchange.

WASM Integration

The MT63 Audio Worklet uses the @hamstudy/mt63-wasm library for MT63 processing. This library provides the core functionality in a WebAssembly (WASM) module. The WASM binary is loaded using the fetch API and initialized with the initialize function from @hamstudy/mt63-wasm. The binary is then passed to the audio worklet for processing.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.