GithubHelp home page GithubHelp logo

calmera / chromaprint.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bjjb/chromaprint.js

0.0 2.0 0.0 41 KB

A JavaScript implementation of AcoustID Chromaprint

License: GNU Lesser General Public License v3.0

CoffeeScript 96.43% JavaScript 0.75% HTML 2.82%

chromaprint.js's Introduction

chromaprint.js

A JavaScript implementation of AcoustID Chromaprint. Provides a web library for calculating chromatic fingerprints of audio data in a Javascript runtime (such as the browser or Node), and a command-line implementation of fpcalc, which gets fingerprints of local files.

Installation and usage

NodeJS

npm install -g chromaprint
fpcalc -h

or

npm install chromaprint
./node_modules/.bin/fpcalc -h

Browser

    <!-- attaches a chromaprint object to window -->
    <script src="path/to/chromaprint.js"><script>
    <script>
        // Assuming loadAudio gets a decoded audio stream.
        loadAudio(url, function(stream) {
            chromaprint.calculateFingerprint(stream, console.log);
        });
    </script>

API

The top-level chromaprint object has a number of factory functions, which it exposes purely for testing. The public API is pretty thin, though.

  • chromaprint.calculateFingerprint(stream, [options], callback) Calls callback with the compressed and Base64 encoded fingerprint (a String).
  • chromaprint.calculateRawFingerprint(stream, [options], callback) Calls callback with the uncompressed fingerprint (a Buffer).
  • chromaprint.compress(buffer) Compresses a buffer, returning a compressed Buffer.
  • chromaprint.base64encode(buffer) Encodes the bytes in the buffer into a Base64 String.

Testing and development

    git clone https://github.com/bjjb/chromaprint.js
    cd chromaprint.js
    npm install
    npm test
    npm test:server # starts a mocha test server

Report issues to the issue tracker.

Further reading

There may be something of intrest in the wiki

License, copyright, thanks, etc

chromaprint.js is licenced under the LGPL (same as chromaprint). See the included LICENSE file.

It was written by bjjb, as a port of Lukáš Lalinský's original C++ library. You can read more in the README.md of the lib/] directory.

chromaprint.js's People

Contributors

bjjb avatar

Watchers

James Cloos avatar Daan Gerits avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.