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

@audio/loudness-sounds

v1.0.2

Published

Sound labeling — level-threshold region detection (Audacity Label Sounds)

Readme

@audio/loudness-sounds npm MIT

Sound labeling — level-threshold region detection (Audacity Label Sounds)

npm install @audio/loudness-sounds
import sounds from '@audio/loudness-sounds'

Region detector modeled on Audacity's Label Sounds analyzer — not a loudness metric, but a level-threshold segmenter that ships in this family for the same input pipeline. 10 ms chunks are classed sound/silence against a level threshold, adjacent sound regions closer than minSilence are merged, regions shorter than minSound are folded into the next, and each surviving region is padded (pre/post) into its neighboring silence — never past a neighboring sound boundary, per the manual: "labels can overlap other labels, but cannot overlap previous or following sounds."

sounds(channels, { threshold: -30, minSilence: 1, minSound: 1 })

| Param | Default | | |---|---|---| | fs | 48000 | Sample rate, Hz | | threshold | -30 | dB level splitting sound from silence | | measurement | 'peak' | 'peak' (max |x|, most sensitive — catches low-duty-cycle transients), 'avg' (mean |x|), or 'rms' (sqrt mean x²) | | minSilence | 1 | Silence gaps shorter than this (seconds) are closed, merging the regions either side | | minSound | 1 | Regions shorter than this (seconds) are folded into the following region | | pre | 0 | Seconds to pad each region's start into leading silence | | post | 0 | Seconds to pad each region's end into trailing silence | | max | 10000 | Maximum number of regions returned |

Accepts Float32Array (mono) or Float32Array[] (multichannel — chunk level is computed across all channels together). Returns an array of { at, duration, label } (label = 'Sound N'), ordered by position.

Use when: auto-splitting a long recording into per-take/per-phrase regions, silence trimming, or generating label tracks for editors.

Modeled on Audacity's Label Sounds analyzer; a level-threshold segmenter, not an ITU-R/EBU loudness measurement.


Part of @audio/loudness — the loudness family umbrella. Documented from the reference implementation.

MIT © audiojs