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

st-shazam

v1.0.1

Published

A Node.js implementation of Shazam-like audio recognition using fingerprinting algorithm

Readme

ST-Shazam

Package Name: st-shazam (npm compatible) | Display Name: ST Shazam

A Node.js implementation of Shazam-like audio recognition using advanced audio fingerprinting algorithms. This project can identify songs from audio files by generating acoustic fingerprints and matching them against the Shazam database.

🎵 Features

  • Audio Recognition: Identify songs from audio files (MP3, WAV, etc.)
  • Audio Fingerprinting: Generate unique acoustic signatures using FFT and peak detection
  • Shazam API Integration: Match fingerprints against Shazam's vast music database
  • Audio Processing: Automatic conversion and normalization of audio files

📋 Requirements

  • Node.js (v14 or higher)
  • FFmpeg (automatically installed via @ffmpeg-installer/ffmpeg)

🚀 Installation

# Clone the repository
git clone https://github.com/sheikhtamimlover/ST-Shazam.git

# Navigate to project directory
cd ST-Shazam

# Install dependencies
npm install

💻 Usage

Command Line

# Recognize a song from an audio file
node ST.js <path_to_audio_file>

# Or use npm start
npm start ./audio.mp3

# Example
node ST.js ./audio.mp3

As a Module

const { recognizeSong } = require('st-shazam');
// Or if using locally: const { recognizeSong } = require('./index.js');

async function identify() {
  try {
    const result = await recognizeSong('./your-audio-file.mp3');
    
    if (result.matches && result.matches.length > 0) {
      console.log('Song found!');
      console.log('Title:', result.matches[0].track?.title);
      console.log('Artist:', result.matches[0].track?.subtitle);
    } else {
      console.log('No matches found');
    }
  } catch (error) {
    console.error('Recognition failed:', error);
  }
}

identify();

🔧 How It Works

  1. Audio Processing: The input audio is converted to mono 16kHz PCM format using FFmpeg
  2. Fingerprint Generation: Audio samples are analyzed using FFT to generate a unique acoustic signature
  3. API Request: The fingerprint is sent to Shazam's API for matching
  4. Result: Returns song metadata including title, artist, album, and more

📦 Dependencies

  • axios: HTTP client for API requests
  • uuid: Generate unique device and session IDs
  • fluent-ffmpeg: Audio processing and format conversion
  • @ffmpeg-installer/ffmpeg: FFmpeg binary installer
  • fft.js: Fast Fourier Transform implementation

📁 Project Structure

ST-Shazam/
├── src/
│   ├── algorithm.js         # Fingerprint generation algorithm
│   ├── signature-format.js  # Signature encoding/decoding
│   └── hanning.js           # Hanning window function
├── ST.js                    # Main entry point (CLI tool)
├── index.js                 # Core module exports (recognizeSong, processAudio)
├── package.json             # Project configuration
└── README.md                # This file

🔑 API Information

This project uses Shazam's unofficial API with an included authentication token. The package works out of the box without requiring any additional setup or configuration.

🎯 Use Cases

  • Music identification apps
  • Audio recognition services
  • Music discovery platforms
  • Audio content analysis tools
  • Educational projects on audio processing

⚠️ Limitations

  • Recognition accuracy depends on audio quality
  • Requires internet connection for API access
  • API rate limits may apply
  • Only identifies songs in Shazam's database

👨‍💻 Author

Sheikh Tamim

📄 License

MIT License - feel free to use this project for personal or commercial purposes.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

🌟 Acknowledgments

  • Shazam for their amazing music recognition technology
  • The open-source community for the audio processing libraries

Made with ❤️ by Sheikh Tamim