rembo10/headphones — Issue #464: Request - AcoustId Fingerprinting
Author: sbuser
Created: 2012-01-29 21:36:05+00:00
State: open

Acoustid has come along to the point that most users should be able to use it with headphones. The easiest way to add support in headphones would be to use the pyacoustid library: https://github.com/sampsyo/pyacoustid

The pyacoustid library depends on some version of chromaprint being installed and available on the system. Lucas Lalinsky has made this very easy: http://acoustid.org/chromaprint

Windows users would need to get the static binaries and also set an environment variable (or have an options in Headphones for the path to fpcalc.exe). Most everyone else should be able to build the packages easily (he has some built for osx, linux, etc). Then adding the acoustic fingerprinting to Headphones is a matter of something like:

```python
import acoustid

duration, fp = _fingerprint_file_fpcalc(path)
response = lookup(apikey, fp, duration, meta)
if parse:
return parse_lookup_result(response)
```

A few more lines is all it takes to save the acoustid_id, fingerprint, and duration to the Mediafile. It would be great if headphones supported this for situations where the default autotag of beets doesn't come through - or, even when it does, for future reference with Acoustid.

I should perhaps also note that there is a plugin that does this for beets now - but it depends on the import event in beets and I don't think you'd be able to catch that event with the way autotag is being called. In any case it really is like 15 lines of code to get high quality audio fingerprints in every file.