chromaprint

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

chromaprint provides bindings to the Chromaprint library, which is a library for extracting audio fingerprints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fingerprint added in v1.8.0

func Fingerprint(ctx context.Context, r io.Reader, dur time.Duration, opts ...segmenter.Opt) (*schema.AudioFingerprintResponse, error)

Fingerprint generates an audio fingerprint from the reader. The "dur" parameter specifies the full track duration. Only the first 120 seconds (or less) will be fingerprinted, but the returned Duration will reflect the full track duration. If dur is zero, the duration will be auto-detected from the file.

func New added in v1.6.1

func New(rate, channels int, duration time.Duration) *fingerprint

Create a new fingerprint context, with the expected sample rate, number of channels and the maximum duration of the data to put into the fingerprint. Returns nil if the context could not be created. If duration is zero, defaults to 120 seconds.

func PrintVersion added in v1.6.1

func PrintVersion(w io.Writer)

Types

type Client

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

func NewClient

func NewClient(ApiKey string, opts ...client.ClientOpt) (*Client, error)

Create a new client with rate limiting (3 requests per second by default)

func (*Client) Lookup

func (c *Client) Lookup(fingerprint string, duration time.Duration, flags Meta) ([]*schema.ResponseMatch, error)

Lookup a fingerprint with a duration and the metadata that needs to be returned

type Meta

type Meta uint
const (
	META_RECORDING Meta = (1 << iota)
	META_RECORDINGID
	META_RELEASE
	META_RELEASEID
	META_RELEASEGROUP
	META_RELEASEGROUPID
	META_TRACK
	META_COMPRESS
	META_USERMETA
	META_SOURCE
	META_MIN       = META_RECORDING
	META_MAX       = META_SOURCE
	META_NONE Meta = 0
	META_ALL       = META_RECORDING | META_RECORDINGID | META_RELEASE | META_RELEASEID | META_RELEASEGROUP | META_RELEASEGROUPID | META_TRACK | META_COMPRESS | META_USERMETA | META_SOURCE
)

func (Meta) FlagString

func (m Meta) FlagString() string

func (Meta) String

func (m Meta) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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