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-analysis-core

v1.0.1

Published

React Native audio analysis library with waveform extraction and full audio analysis

Downloads

7

Readme

Audio Analysis Core

A React Native library for audio analysis with waveform extraction and comprehensive audio feature extraction.

Features

  • Waveform Extraction: Extract waveform data from audio files
  • Full Audio Analysis: Comprehensive audio analysis including spectrum, RMS, zero-crossing rate, and more
  • TypeScript Support: Full TypeScript definitions included
  • Cross-Platform: Works on both iOS and Android

Installation

npm install audio-analysis-core
# or
yarn add audio-analysis-core

iOS Setup

cd ios && pod install && cd ..

Android Setup

No additional setup required for Android.

Usage

Basic Waveform Extraction

import { extractWaveform } from 'audio-analysis-core';

const waveform = await extractWaveform({
  fileUri: 'file://path/to/audio.mp3',
  pointsPerSecond: 50, // points per second
  startTimeMs: 0, // start time in milliseconds
  endTimeMs: 10000, // end time in milliseconds (optional)
  decodingOptions: {
    sampleRate: 44100,
    channels: 1,
    bitDepth: 16
  }
});

console.log(waveform.data); // Array of waveform values
console.log(waveform.duration); // Duration in seconds
console.log(waveform.sampleRate); // Sample rate
console.log(waveform.channels); // Number of channels
console.log(waveform.bitDepth); // Bit depth

Full Audio Analysis

import { analyzeAudio } from 'audio-analysis-core';

const analysis = await analyzeAudio({
  fileUri: 'file://path/to/audio.mp3',
  segmentDurationMs: 100, // duration of each data point in milliseconds
  startTimeMs: 0, // start time in milliseconds
  endTimeMs: 10000, // end time in milliseconds (optional)
  features: {
    energy: true,
    rms: true,
    zcr: true,
    spectralCentroid: true,
    mfcc: false
  },
  decodingOptions: {
    sampleRate: 44100,
    channels: 1,
    bitDepth: 16
  }
});

console.log(analysis.dataPoints); // Array of data points
console.log(analysis.durationMs); // Duration in milliseconds
console.log(analysis.sampleRate); // Sample rate
console.log(analysis.numberOfChannels); // Number of channels

API Reference

extractWaveform(options)

Extract waveform data from an audio file (similar to expo-audio-stream's extractPreview).

Parameters:

  • options.fileUri (string): Path to the audio file
  • options.pointsPerSecond (number, optional): Points per second to extract (default: 50)
  • options.startTimeMs (number, optional): Start time in milliseconds (default: 0)
  • options.endTimeMs (number, optional): End time in milliseconds (default: entire file)
  • options.decodingOptions (DecodingOptions, optional): Decoding configuration

Returns: Promise

analyzeAudio(options)

Perform comprehensive audio analysis (similar to expo-audio-stream's extractAudioAnalysis).

Parameters:

  • options.fileUri (string): Path to the audio file
  • options.segmentDurationMs (number, optional): Duration of each data point in milliseconds (default: 100)
  • options.startTimeMs (number, optional): Start time in milliseconds (default: 0)
  • options.endTimeMs (number, optional): End time in milliseconds (default: entire file)
  • options.features (AudioFeatures, optional): Features to extract
  • options.decodingOptions (DecodingOptions, optional): Decoding configuration

Returns: Promise

Types

interface WaveformData {
  data: number[];
  duration: number;
  sampleRate: number;
  channels: number;
  bitDepth: number;
}

interface AudioFeatures {
  energy?: boolean;
  rms?: boolean;
  zcr?: boolean;
  spectralCentroid?: boolean;
  mfcc?: boolean;
  waveform?: boolean;
  spectrum?: boolean;
}

interface DecodingOptions {
  sampleRate?: number;
  channels?: number;
  bitDepth?: number;
}

interface AudioAnalysisDataPoint {
  amplitude: number;
  rms: number;
  db: number;
  energy?: number;
  zcr?: number;
  spectralCentroid?: number;
  mfcc?: number[];
}

interface AudioAnalysisResult {
  segmentDurationMs: number;
  durationMs: number;
  bitDepth: number;
  samples: number;
  numberOfChannels: number;
  sampleRate: number;
  dataPoints: AudioAnalysisDataPoint[];
}

License

MIT