acoustid

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Client struct {
	*client.Client
	// contains filtered or unexported fields
}

Client is a client of the AcoustID API, with the API key of an application which is registered with AcoustID

func New

func New(key string, opts ...client.ClientOpt) (*Client, error)

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

func (c *Client) LookupTrack(ctx context.Context, id string, meta Meta) ([]schema.Result, error)

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
)

func (Meta) String

func (m Meta) String() string

String returns the names of the metadata which the flags select, as AcoustID's meta parameter has them, separated by spaces, such as "recordings releasegroups"

Directories

Path Synopsis
Package schema is the responses of the AcoustID API
Package schema is the responses of the AcoustID API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL