Fingerprint API and app updated

Friday, 9 July 2010
by norman
filed under Announcements
Comments: 14

In our ongoing effort to make the best place for music data, we’ve been using audio fingerprint tech since 2007 to match metadata information (i.e. artist and track names) by analyzing the audio.

This helped us automate the process of spelling correction, and as by-product we released an open source library and a client which can be used to identify the correct metadata for mp3s.

We have recently reached the milestone of 90 million fingerprint entries and all this information is now fully accessible via a new track.getFingerprintMetadata call in our official API, with musicbrainz ids and full UTF-8 support.

If you are a developer you might want to look into the library module (which generates the fingerprint) available on github (and it’s LGPL!). If you just want to play with it, you can use our sample client (available for Windows, OS X and Linux), which query the fingerprint service for an id, then pokes the API for the metadata.

Running the fingerprint client is a piece of cake. Just type

lastfmfpclient mysterious.mp3

and it will generate the following xml output (which is taken from the API):

<?xml version=“1.0” encoding=“utf-8”?>
<lfm status=ok>
    <track rank=1>
      <name>One Summer’s Day</name>
      <streamable fulltrack=0>0</streamable>
      <image size=small></image>
      <image size=medium></image>
      <image size=large></image>
      <image size=extralarge>×300/3737553.jpg</image>
    <track rank=0.404785>
      <name>Ano Natsu he</name>
      <streamable fulltrack=0>0</streamable>
    <track rank=0.144543>
      <streamable fulltrack=0>0</streamable>
      <image size=small></image>
      <image size=medium></image>
      <image size=large></image>
      <image size=extralarge>×300/6624395.jpg</image>


  1. Benjamin Reed
    9 July, 12:11

    FYI, the binaries for OSX don’t work unless you have MacPorts installed. The main binary was properly install_name_tool’d to point to the dylibs/ subdirectory, but all the libraries in dylibs/ still refer to /opt/local stuff that doesn’t exist.

    ./lastfmfpclient —help
    dyld: Library not loaded: /opt/local/lib/libssh2.1.dylib Referenced from: /Users/ranger/Downloads/lastfm/dylibs/libcurl.4.dylib Reason: image not found
    Trace/BPT trap

    (I’d post the otool -L output, but it wouldn’t wrap well)

    Benjamin Reed – 9 July, 12:11
  2. Moshroum
    9 July, 12:22

    With mbid support…. wow. But maybe somebody should add that the mbid will always be empty.

    Moshroum – 9 July, 12:22
  3. Luke
    9 July, 12:29

    Any chance you can fix it where the album artist is assigned to another artist (over-riding the tagged file)? This occurs when a label has uploaded an album’s tracklisting but put it under a bad tag (e.g. album artist = soundtrack). All the albums get scrobbled under the bad tag usually.

    It doesn’t always happen but with a few releases, it does. MusicBrainz data can further sort this or take the album artist “band” tag from the file.

    Luke – 9 July, 12:29
  4. Moshroum
    9 July, 12:31

    The windows client just shows an error c0000142

    Also the client is still missing the ogg vorbis support which was promised in 2007.

    Sorry, only MP3 files are currently supported. But other formats will follow soon!

    Soon is the same soon as in duke nukem forever

    Moshroum – 9 July, 12:31
  5. Luke
    9 July, 12:31

    Also, what’s with the slow times getting tracklistings from MusicBrainz? Some artists’ data NEVER get gathered from MusicBrainz for some reason. Maybe there should be an option for a user to “grab” the data and it will be gathered as soon as possible (in the next dump).

    Luke – 9 July, 12:31
  6. Max Howell
    9 July, 12:37

    Great, happy to see more work here. Now kick Tims in the nads until we can submit Fingerprint IDs with Track.scrobble. I would do it everytime. For serious. Then he can give us this data back as part of the corrections response. The idea makes me giddy. Of course I’m sure there are all sorts of technical concerns that you guys will have a field day solving. Think of the fun!

    Max Howell – 9 July, 12:37
  7. Max Howell
    9 July, 12:52

    Could you host a proper tarball. Or tag the github sources so I can grab a tarball from them (though you guys can certainly afford the bandwidth). Linux etc. will need this for packaging.

    And yeah the install names for the OS X binary are screwed. You have to install_name_tool the dylibs as well as the final binary. Also use @executable_path/.. so that you don’t have to run the binary from its directory.

    Max Howell – 9 July, 12:52
  8. Max Howell
    9 July, 13:05

    Homebrew formula available for those on OS X:

    Just `brew install lastfmfpclient`.

    Max Howell – 9 July, 13:05
  9. Norman Casagrande
    9 July, 13:57

    @Benjamin Reed: good one, thanks!

    @Luke: We are working on something like that: stay tuned!

    @Moshroum: Can you get it to fetch the fpid with ‘-nometadata’ option? Yeah, support for other formats has been lacking. But bear in mind that the app is there just to demonstrate the use of the library (which requires plain PCM data).

    @Max: Will do! Thanks for the brew, man: I am not too much into osx coding. I’ll pay you a beer next time we meet. :)

    Norman Casagrande – 9 July, 13:57
  10. Leniel Macaferi
    9 July, 15:17

    When I try to run the Windows client version at the command prompt with:

    lastfmfpclient track1.mp3

    I get the following error:

    lastfmfpclient has stopped working.

    I’m using Windows 7 with .Net Framework 4.0 installed.

    Am I missing something? Any idea?


    Leniel Macaferi – 9 July, 15:17
  11. Norman Casagrande
    9 July, 16:19

    @Leniel Macaferi: have you tried with a different mp3? Did you run the executable from its own directory?

    Norman Casagrande – 9 July, 16:19
  12. adchelle
    11 July, 11:18

    Does all this techno babble actually mean that we’re closer to sorting out the mess that is ‘having one page for multiple artists with the same name’? If it doesn’t mean that, then I don’t really care.

    adchelle – 11 July, 11:18
  13. DJ
    26 July, 20:55

    Thank you for the information

    DJ – 26 July, 20:55
  14. itsolutioners
    18 August, 12:09

    Of course it’s stored locally, but as to whether or not it is clandestinely transmitted to a data base off site is really a matter of trust…do you trust the corporate and governing agencies of any country to NOT pry into your life?
    “Backdoor” code, inserted into these massive Operating Systems (for the most part un-inspected by the public) may never be known with certainty; and there is a lot of incentive to have these kinds of facts on file for future use by some group for the monitoring of it’s citizens.
    All this is of course ‘for our own good’, which is the common mantra espoused by these collecting ‘agencies’, as in the case of ‘marketing preferences’.
    Constant spoon-feeding of the idea that by monitoring us as individuals will insure some kind of smooth delivery of just what we want, just when we want it: and “it’s all a good thing” or “harmless”, has desensitized us to this snooping, as witnessed by some Y! Answers that imply that ‘tracking cookies’ are “harmless”…and so they are: until that data is annexed by another group for totally unforseen purposes, to God only knows what end.

    Personally, I have serious doubts about the future use of all these data bases, and that scares anyone who follows history: there has never been a government that didn’t abuse it’s power over it’s citizens (with time) and not come away hungry for more.

    It’s all a matter of trust.

    itsolutioners – 18 August, 12:09

Comments are closed for this entry.