chromaprint

package
v3.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrQueryRateExceeded = fmt.Errorf("Query Rate Exceeded (%v qps)", defaultQps)
)

Functions

This section is empty.

Types

type Client

type Client struct {
	gopi.Unit
	gopi.Logger
	sync.Mutex
	*http.Client
	*url.URL
	// contains filtered or unexported fields
}

func (*Client) Define

func (this *Client) Define(cfg gopi.Config)

func (*Client) Lookup

func (this *Client) Lookup(fingerprint string, duration time.Duration, flags Meta) ([]*Match, error)

func (*Client) New

func (this *Client) New(cfg gopi.Config) error

func (*Client) String

func (this *Client) String() string

type Manager

type Manager interface {
	// NewStream will create a new stream object for calculating the fingerprint
	NewStream(rate, channels int) (Stream, error)

	// Close releases stream resources
	Close(Stream) error
}

type Match

type Match struct {
	Id    string  `json:"id"`
	Score float64 `json:"score"`
}

func (*Match) String

func (this *Match) String() string

type Meta

type Meta uint
const (
	META_NONE      Meta = 0
	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_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

type Stream

type Stream interface {

	// Write signed data into the stream, assuming little endian order
	Write(data []int16) error

	// GetFingerprint calculates the fingerprint from the streamed data
	GetFingerprint() (string, error)

	// Properties
	// Duration returns the current duration of the streamed data
	Duration() time.Duration

	// Channels returns the number of audio channels the stream represents
	Channels() int

	// Rate returns the samples per second (aka Sample rate)
	Rate() int
}

Jump to

Keyboard shortcuts

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