Audio-Ofa-Util
view release on metacpan or search on metacpan
The fingerprint is calculated by "ofa_create_print" in Audio::Ofa, and
the "fingerprint" field of the object will be set. Additionally, the
"duration" (in milliseconds) and the "extension" will be set to the
values provided by the file name.
In case of an error, an empty list is returned and the error message can
be retrieved via "error". Otherwise, a true value will be returned.
musicdns_lookup
This looks up a track at the MusicDNS web service.
To do a fingerprint lookup, the keys "fingerprint" and "duration" must
be present, where duration is the length of the song in milli seconds.
Additionally, the following fields (defaults in parentheses) will be
sent to the MusicDNS service:
client_id (hardcoded client id), client_version (module name and
version), fingerprint, metadata (1), bitrate (0), extension ("unknown"),
duration, artist ("unknown"), title ("unknown"), album ("unknown"),
track (0), genre ("unknown"), year (0).
In the case of an error, "musicdns_lookup" returns an empty list and the
error message can be retrieved with the "error" method.
In the case of success, "musicdns_lookup" sets the fields "puids" to the
found PUIDs, and sets the fields "artist" and "title" to the first of
the found values, and returns a true value. In list context, it returns
a list of objects which have "artist", "title" and "puid" methods.
musicbrainz_lookup
This looks up a PUID at MusicBrainz. The PUID can come from a call to
"musicdns_lookup". In fact this is implicitly done if there is no PUID
stored in the object (cf. "SYNOPSIS").
This returns a list of WebService::MusicBrainz::Response::Track objects
on success, or the first of them in scalar context. Otherwise it returns
an empty list and the error message can be retrieved via the "error"
method.
This method returns a list of tracks or the first track in scalar
context. The tracks are represented as objects that are guaranteed to
lib/Audio/Ofa/Util.pm view on Meta::CPAN
$this->fingerprint($fp);
$this->duration($duration);
$this->extension($extension);
return 1;
}
=head2 musicdns_lookup
This looks up a track at the MusicDNS web service.
To do a fingerprint lookup, the keys C<fingerprint> and C<duration> must be
present, where duration is the length of the song in milli seconds.
Additionally, the following fields (defaults in parentheses) will be sent to
the MusicDNS service:
client_id (hardcoded client id), client_version (module name and version),
fingerprint, metadata (1), bitrate (0), extension ("unknown"), duration, artist
("unknown"), title ("unknown"), album ("unknown"), track (0), genre
("unknown"), year (0).
lib/Audio/Ofa/Util.pm view on Meta::CPAN
$_->{artist}, $_->{title}, $_->{puids}[0]
), @return;
} else {
return 1;
}
}
=head2 musicbrainz_lookup
This looks up a PUID at MusicBrainz. The PUID can come from a call to
L</musicdns_lookup>. In fact this is implicitly done if there is no PUID
stored in the object (cf. L</SYNOPSIS>).
This returns a list of L<WebService::MusicBrainz::Response::Track> objects on
success, or the first of them in scalar context.
Otherwise it returns an empty list and the error message can be retrieved via
the L</error> method.
This method returns a list of tracks or the first track in scalar context. The
tracks are represented as objects that are guaranteed to have the methods
( run in 0.509 second using v1.01-cache-2.11-cpan-607d282f910 )