audio

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: MIT Imports: 5 Imported by: 4 modules, 5 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

Index

Constants

This section is empty.

Variables

View Source
var MetadataReaders = make(map[Codec]func(string) (Metadata, error))
View Source
var Stats struct {
	Identify     stat.Run
	ReadMetadata stat.Run
}

Functions

This section is empty.

Types

type Codec

type Codec int
const (
	Unknown Codec = iota

	WAV // Wave­form Audio File For­mat

	ALAC // Apple Lossless Audio Codec
	FLAC // Free Lossless Audio Codec
	APE  // Monkey's Audio
	OFR  // OptimFROG
	TAK  // Tom's verlustfreier Audiokompressor
	WV   // WavPack
	TTA  // True Audio
	WMAL // Windows Media Audio Lossless

	MP3 // MPEG-Lyaer 3 Audio
	M4A // MPEG4 Audio
	M4B // MPEG4 Audio Book
	M4P // MPEG4 Protected Audio
	AAC // Advanced Audio Coding
	OGG // Vorbis
	WMA // Windows Media Audio
)

func Identify

func Identify(file string) (Codec, error)

func (Codec) String

func (c Codec) String() string

type Metadata

type Metadata interface {
	Title() string         // The primary song title
	Album() string         // The album the song belongs to
	Artist() string        // The primary performer/artist of the song
	AlbumArtist() string   // The album artist
	Composer() string      // The composer of the song
	Year() int             // The release year of the song (not necessarily recording year)
	Genre() string         // The genre of the song
	Track() (int, int)     // The track number of the song, 0 for unknown
	Disc() (int, int)      // The disc number of the song, 0 for unknown
	Length() time.Duration // The length of the song in milliseconds
	Comment() string       // A comment
	Copyright() string     // Copyright notice, usually in the form YYYY Name
	Website() string       // Website of the performer

	EncodedBy() string       // Who encoded the audio
	EncoderSettings() string // Any specific encoder settings
	Encoding() Codec         // Codec returns the file codec, or Unknown.
	EncodingBitrate() int    // Bitrate returns the file bitrate in Kbps, or -1 if unknown.

	OriginalFilename() string // The original filename of the song
}

func ReadMetadata

func ReadMetadata(file string) (Metadata, error)

Directories

Path Synopsis
Package flac implements FLAC decoding.
Package flac implements FLAC decoding.

Jump to

Keyboard shortcuts

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