Skip to content

Latest commit

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Shazam Api for JavaScript

This library is heavily based on Numenorean's work.

Usage:

import{Shazam,s16LEToSamplesArray}from'shazam-api';importfsfrom'fs';constshazam=newShazam();constfileContents=fs.readFileSync("test.pcm");constsamples=s16LEToSamplesArray(fileContents);constsongData=awaitshazam.recognizeSong(samples);console.log(songData);

The data passed to s16LEToSamplesArray needs to be raw PCM with:

  • Sample rate set to 16000Hz
  • Bit depth set to 16 bits
  • 1 channel of audio

Such a file can be generated with ffmpeg using the command:

ffmpeg -i <source file> -ar 16000 -ac 1 -f s16le test.pcm

Or within node or the browser thanks to ffmpeg.wasm

Using within a browser

To use this project within a browser, you need to deploy a userscript which will let you bypass CORS while accessing the Shazam servers.

About

Fully reverse engeenired shazam api based on Numenorean's ShazamAPI

Resources

Stars

33 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages