Documentation
¶
Overview ¶
Package acoustid implements a client for the AcoustID API, which looks up the recordings which a Chromaprint fingerprint of audio is, and their MusicBrainz identifiers https://acoustid.org/webservice
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a client of the AcoustID API, with the API key of an application which is registered with AcoustID
func New ¶
New creates an AcoustID client with the API key of an application, which is registered at https://acoustid.org/new-application, and options. Its requests are limited to three each second, which AcoustID allows.
func (*Client) Lookup ¶
func (c *Client) Lookup(ctx context.Context, fingerprint string, duration time.Duration, meta Meta) ([]schema.Result, error)
Lookup returns the AcoustID tracks which the Chromaprint fingerprint of audio of the duration matches, with the best match first, and their metadata, such as their recordings and releases, which the meta flags select. The duration is of the whole of the audio, rather than of the part which was fingerprinted, and is in whole seconds. A fingerprint which matches nothing has no tracks.
func (*Client) LookupTrack ¶
LookupTrack returns the AcoustID track with the identifier, such as the one which MusicBrainz Picard writes in the tags of audio, and its metadata, such as its recordings, which the meta flags select. An identifier which isn't known has no track.
type Meta ¶
type Meta uint
Meta selects the metadata of the tracks which a lookup returns, such as their recordings and releases
const ( // MetaRecordings is the recordings of a track, their titles, durations // and artists MetaRecordings Meta = 1 << iota // MetaRecordingIDs is the MusicBrainz identifiers of the recordings of a // track, only, which AcoustID returns in place of MetaRecordings MetaRecordingIDs // MetaReleases is the releases of the recordings MetaReleases // MetaReleaseIDs is the MusicBrainz identifiers of the releases, only, // which AcoustID returns in place of MetaReleases MetaReleaseIDs // MetaReleaseGroups is the release groups of the recordings, such as // albums and singles MetaReleaseGroups // MetaReleaseGroupIDs is the MusicBrainz identifiers of the release // groups, only, which AcoustID returns in place of MetaReleaseGroups MetaReleaseGroupIDs // MetaTracks is the tracks of the releases, with their positions on the // releases' mediums MetaTracks // MetaCompress is a smaller response, without the duplicate metadata of // recordings and releases, such as the artists of release groups MetaCompress // MetaUserMeta is the metadata which users submitted MetaUserMeta // MetaSources is how many times each recording was submitted MetaSources // MetaNone is no metadata, only the tracks' identifiers and scores MetaNone Meta = 0 // MetaAll is all the metadata, without the flags which return less of // it: the identifiers only, which AcoustID returns in place of the // metadata, and a compressed response MetaAll = MetaRecordings | MetaReleases | MetaReleaseGroups | MetaTracks | MetaUserMeta | MetaSources )