Audio::Ofa::Util

Retrieve audio fingerprints and metadata for unknown audio files
Download

Audio::Ofa::Util Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Christoph Bu?enius
  • Publisher web site:
  • http://search.cpan.org/~pepe/

Audio::Ofa::Util Tags


Audio::Ofa::Util Description

Retrieve audio fingerprints and metadata for unknown audio files Audio::Ofa::Util is a Perl module that tries to make retrieving audio fingerprints and metadata for unknown audio files as easy as possible. It interfaces with the modules Audio::Ofa and WebService::MusicBrainz, provides a simple LWP based interface to the MusicDNS library, and can make use of Audio::Extract::PCM to read some popular music formats.SYNOPSISThe most comprehensive way to use this is to start with a (possibly untagged) file name and get full metadata: my $util = Audio::Ofa::Util->new(filename => 'song.ogg'); my @tracks = $util->musicbrainz_lookup or die $util->error; for (@tracks) { print 'Artist: ', $_->artist, " "; print 'Title: ', $_->title, " "; print 'Track: ', $_->track, " "; print 'Album: ', $_->album, " "; }To create an audio fingerprint: my $util = Audio::Ofa::Util->new(filename => 'song.ogg'); $util->analyze_file or die $util->error; print $util->fingerprint, " ";To create a fingerprint and look it up at MusicDNS: my $util = Audio::Ofa::Util->new(filename => 'song.ogg'); $util->musicdns_lookup or die $util->error; # calls analyze_file implicitly print $util->artist, ' - ', $util->title, " ";To look up a known fingerprint at MusicDNS (you need the length of the song, too): my $util = Audio::Ofa::Util->new(fingerprint => $fp, duration => $millisecs);The overall process goes like this:* We create an audio fingerprint, which stores some characteristics of a recording in a rather small amount of data. This is what libofa (and the Perl binding in Audio::Ofa) does. This module (Audio::Ofa::Util) faciliates this with "analyze_file" by allowing to fingerprint some widely used music formats and storing the results so they can be used for the next steps:* The audio fingerprint is submitted to the MusicDNS web service. Using a proprietary fuzzy algorithm and their database, they determine which song we have at hand. MusicDNS returns some metadeta: The artist, the song title, and a PUID. This "portable unique identifier" is an arbitrary index into their database and is unique for every recording of a given song.Note that while libofa's audio fingerprints may change after transformations of a recording (such as lossy audio compression or radio transmission), the fuzzy algorithm will (ideally) still find the same PUID.* Because we usually want to know more than the artist and title, we look up the PUID in a second Web Database called MusicBrainz. It provides us with all desired metadata such as all the albums the song has appeared on in this particular version, and the respective track numbers.This module provides a basic MusicBrainz PUID lookup through "musicbrainz_lookup". If you want to know even more (such as members of the band and the previous bands of those members), you can use WebService::MusicBrainz, to which this module provides an easy frontend. Requirements: · Perl


Audio::Ofa::Util Related Software