# fpcalc

> Calculate AcoustID audio fingerprint

Latest version **1.3.0** (published 2018-10-18) · Public Domain license · 0 weekly downloads

## Install

```sh
npm install fpcalc
pnpm add fpcalc
yarn add fpcalc
bun add fpcalc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-10-18 |
| First published | 2013-07-30 |
| Weekly downloads | 0 |
| License | Public Domain |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 201.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 76 |
| Author | Parsha Pourkhomami |
| Maintainers | parshap |
| Keywords | fpcalc, chromaprint, acoustid, musicbrainz, music, audio, fingerprint, mp3 |

## Links

- npm: https://www.npmjs.com/package/fpcalc
- Repository: https://github.com/parshap/node-fpcalc
- Homepage: https://github.com/parshap/node-fpcalc#readme
- Issues: https://github.com/parshap/node-fpcalc/issues
- npm.io page: https://npm.io/package/fpcalc

## Dependencies (5)

- [once](https://npm.io/package/once.md) ^1.3.2
- [event-stream](https://npm.io/package/event-stream.md) ^3.3.1
- [concat-stream](https://npm.io/package/concat-stream.md) ^1.5.0
- [stream-filter](https://npm.io/package/stream-filter.md) ^1.0.0
- [stream-reduce](https://npm.io/package/stream-reduce.md) ^1.0.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2018-10-18
- 1.2.1 — 2016-04-20
- 1.2.0 — 2016-04-08
- 1.1.2 — 2015-10-06
- 1.1.1 — 2014-09-10
- 1.1.0 — 2014-09-10
- 1.0.6 — 2013-10-17
- 1.0.5 — 2013-08-09
- 1.0.4 — 2013-07-31
- 1.0.3 — 2013-07-30
- 1.0.2 — 2013-07-30
- 1.0.1 — 2013-07-30
- 1.0.0 — 2013-07-30

## README

# fpcalc

This module is a wrapper around the [`fpcalc` command-line tool][chromaprint]
and provides a node interface to calculate [AcoustID][] audio
fingerprints for audio files.

[chromaprint]: http://acoustid.org/chromaprint
[acoustid]: http://acoustid.org/

## Installing Chromaprint

[`fpcalc` (provided by *Chromaprint*)][chromaprint] must be installed for
this module to function.

**OSX using Homebrew**

```
$ brew install chromaprint
```

**Ubuntu**

```
$ sudo apt-get install libchromaprint-tools
```

## Example

```js
var fpcalc = require("fpcalc");
fpcalc("./audio.mp3", function(err, result) {
  if (err) throw err;
  console.log(result.file, result.duration, result.fingerprint);
});
```

## API

### `fpcalc(file, [options,] callback)`

Calculates the fingerprint of the given audio file.

*File* must be the path to an audio file or a readable stream.

If using a stream, note that you will not get `duration` out due to an [fpcalc issue](https://github.com/acoustid/chromaprint/issues/53).

*Options* may be an object with any of the following keys:

 * `length`: Length of the audio data used for fingerprint calculation
   (passed as `-length` option)
 * `raw`: Output the raw uncompressed fingerprint (default: `false`)
 * `command`: Path to the fpcalc command (default: `"fpcalc"` - expects
   executable in `$PATH`)

*Callback* must be a function that will be called with `callback(err,
result)` once the fingerprint is calculated. The *result object* will
contain the following keys:

 * `file`: Path to the audio file
 * `duration`: Duration of audio file in seconds
 * `fingerprint`: Fingerprint of audio file - *Buffer* if `options.raw`,
   *String* otherwise

## Installation

```
npm install --save fpcalc
```

---
_Source: https://npm.io/package/fpcalc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
