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

@vaudio/utils

v0.0.2

Published

Utility functions for audio processing and visualization

Readme

@vaudio/utils

A utility toolkit for real-time audio analysis and smoothing

@vaudio/utils provides a set of helper functions to analyze audio data from a Web Audio AnalyserNode, as well as a class for smoothing values over time. All values are normalized to a 0–1 range for easy integration with animation and visualization systems.


📦 Installation

npm install @vaudio/utils

🔧 AudioUtils API

All functions accept a Uint8Array representing raw frequency or time-domain audio data (typically from analyser.getByteFrequencyData(...)).

getAverage(audioData: Uint8Array): number

Returns the average value of the audio data, normalized to 0–1.

getPeak(audioData: Uint8Array): number

Returns the maximum value of the audio data, normalized to 0–1.

getRMS(audioData: Uint8Array): number

Returns the Root Mean Square (RMS) value — a measure of audio power.

getBandEnergy(audioData: Uint8Array, start: number, end: number): number

Returns the normalized average energy within a specific index range.

getBassEnergy(audioData: Uint8Array): number

Energy in the lower 0–10% of the frequency spectrum.

getMidEnergy(audioData: Uint8Array): number

Energy in the 10–50% midrange of the frequency spectrum.

getTrebleEnergy(audioData: Uint8Array): number

Energy in the 50–90% high-frequency range.

getCentroid(audioData: Uint8Array): number

Computes the spectral centroid, or the "center of mass" of the frequency spectrum.

getDynamicRange(audioData: Uint8Array): number

Calculates the range between the minimum and maximum values in the audio data.


🧮 SmoothedValue

A lightweight utility class for smoothing noisy values over time. Great for animations and easing effects.

constructor(alpha?: number)

  • alpha – smoothing factor (default: 0.1)

update(next: number): number

Feeds a new value into the smoother and returns the smoothed result.

get(): number

Returns the current smoothed value.

reset(val?: number): void

Resets the smoothed value.


✅ Example Usage

import { AudioUtils, SmoothedValue } from '@vaudio/utils';

const avg = AudioUtils.getAverage(audioData);
const bass = AudioUtils.getBassEnergy(audioData);

const smoothedBass = new SmoothedValue(0.2);
const displayValue = smoothedBass.update(bass);

📘 License

MIT