tagdata

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 3 Imported by: 0 modules, 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 tagdata defines the values shared by the codec metadata parsers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ID3GenreName

func ID3GenreName(index uint64) string

ID3GenreName returns the name for a standard ID3v1 genre index. ID3v2.4 Appendix A lists the indexes used by ID3 and iTunes.

func WithReadContext

func WithReadContext(ctx context.Context, source io.ReaderAt) io.ReaderAt

WithReadContext checks cancellation between metadata reads. Artwork views acquire their own context when opened.

Types

type Artwork

type Artwork struct {
	MIMEType    string
	Role        ArtworkRole
	Description string
	Size        int64
	// contains filtered or unexported fields
}

Artwork is a bounded view of an encoded image. Its input must remain open while the returned reader is in use.

func NewArtwork

func NewArtwork(source io.ReaderAt, offset, size int64, mime string, role ArtworkRole, description string) Artwork

NewArtwork records an already validated byte extent.

func NewTransformedArtwork

func NewTransformedArtwork(source io.ReaderAt, offset, storedSize, decodedSize int64, mime string, role ArtworkRole, description string, decode func(io.Reader) io.Reader) Artwork

NewTransformedArtwork records a stored byte extent that is decoded on open. A decoded size of -1 means it cannot be determined from the headers.

func (Artwork) Open

func (a Artwork) Open(ctx context.Context) (io.ReadCloser, error)

Open returns an independent reader for the original encoded artwork.

type ArtworkRole

type ArtworkRole uint8

ArtworkRole describes how the source identified an image.

const (
	Other ArtworkRole = iota
	FrontCover
	BackCover
)

type Result

type Result struct {
	Texts    []Text
	Pictures []Artwork
}

Result holds the parsed fields and pictures from an audio source.

type Scope

type Scope uint8

Scope identifies the part of a source described by a tag.

const (
	File Scope = iota
	SelectedTrack
	AlbumScope
	Stream
)

type SourceTag

type SourceTag struct {
	Namespace string
	Name      string
	Qualifier string
	Values    []string
	Language  string
	Locale    uint32
	Scope     Scope
}

SourceTag retains a text field as represented by its source format.

type Text

type Text struct {
	SourceTag
	Key tag.Key
	// Normalized is set by format readers that decode a native value.
	Normalized []string
}

Text combines a source field with its optional canonical mapping.

func (Text) LookupValues

func (t Text) LookupValues() []string

Jump to

Keyboard shortcuts

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