AudioFile::Identify::MusicBrainz::Query
The main query object. This is probably the thing you want to use.
userAgent()returns a singleton LWP::UserAgent configured for use in retrieving
data from MusicBrainz.org.
FileInfoLookup($query)Perform a MusicBrainz FileInfoLookup query - this is the clever one that I care about. $query here is a hash / hashref where the keys are the information you know:
use AudioFile::Identify::MusicBrainz::Query; my $query = AudioFile:::Identify::MusicBrainz::Query->new(); $query->FileInfoLookup( artist => 'coldplay', title => 'yellow', items => 30, ) or die "Could not query: " . $query->error(); print "I got ".scalar(@{$query->results})." results\n";
keys you can use in the query are:
the trm - the audio fingerprint of the song. Generating this is a Future Project.
the artist name. Either this key or artist_id must be supplied for a query to be valid.
The artist ID assigned by MusicBrainz, without the 'http' portion. For example, '3d2b98e5-556f-4451-a3ff-c50ea18d57cb'.
the album name
The album ID assigned by MusicBrainz, without the 'http' portion. For example, '2d5d5d4c-d0d7-4772-962f-de7185605ff8'.
the track title
The track ID assigned by MusicBrainz, without the 'http' portion. For example, 'f27a903c-f5cc-465f-91c4-5c67d8b3d6d6'.
the track number
the track length in seconds
the filename of the track
This function will return true on success, false on error, and an error will
be accessible through the error function.
returns the unparsed RDF text of the response generated by Query.
returns the last error generated by Query.
returns a listref of AudioFile::Identify::MusicBrainz::Result objects.
returns a given result, at a given index, or undef if the result
set doesn't contain a result at that index value.
resultCount()returns the number of items in the results set.