Documentation ¶
Index ¶
- Constants
- Variables
- func CheckFLACHead(path string) error
- func IsValidTag(tagName string) bool
- func OnlyKeepLettersAndNumbers(s string) string
- func SmartArtistList(artists []string) string
- func StringContainsStartOfAnother(mainString, subString string, minTitleSize int) bool
- type Flac
- func (f *Flac) AddCover(cover string, maxSizeKb int) error
- func (f *Flac) AddCoverFromBytes(coverData []byte) error
- func (f *Flac) AddTag(field string, value string) error
- func (f *Flac) ApplyTags(t *Tags) error
- func (f *Flac) Check() error
- func (f *Flac) CheckCompression() error
- func (f *Flac) CheckDiscNumberInFilename() bool
- func (f *Flac) CheckFilenameContainsStartOfTitle(minTitleSize int) bool
- func (f *Flac) CheckForID3v1Tags() error
- func (f *Flac) CheckForMQAMetadata() bool
- func (f *Flac) CheckForMQASyncword() (bool, error)
- func (f *Flac) CheckMetadataSize(maxSize int) error
- func (f *Flac) CheckMinimalTags() error
- func (f *Flac) CheckNotCombinedTrackNumber() bool
- func (f *Flac) CheckTrackNumberInFilename() bool
- func (f *Flac) ClearMetadata()
- func (f *Flac) CommonTags() *Tags
- func (f *Flac) CompareBitDepth(o *Flac) bool
- func (f *Flac) CompareEncoding(o *Flac) bool
- func (f *Flac) CompareSampleRate(o *Flac) bool
- func (f *Flac) HasMinimalTags() bool
- func (f *Flac) OverwriteTags(t *Tags) error
- func (f *Flac) RawTags() map[string][]string
- func (f *Flac) SaveTags() error
- func (f *Flac) SetAlbum(value string) error
- func (f *Flac) SetAlbumArtists(values []string, separateTags bool) error
- func (f *Flac) SetArtists(values []string, separateTags bool) error
- func (f *Flac) SetAuthors(values []string, separateTags bool) error
- func (f *Flac) SetComposers(values []string, separateTags bool) error
- func (f *Flac) SetConductors(values []string, separateTags bool) error
- func (f *Flac) SetDescription(value string) error
- func (f *Flac) SetDiscNumber(current, total string) error
- func (f *Flac) SetDuration(value string) error
- func (f *Flac) SetGenre(value string) error
- func (f *Flac) SetISRC(isrc string) error
- func (f *Flac) SetMedia(value string) error
- func (f *Flac) SetPerformers(values []string, separateTags bool) error
- func (f *Flac) SetRecordLabel(label string) error
- func (f *Flac) SetReleaseDate(value string) error
- func (f *Flac) SetRemixers(values []string, separateTags bool) error
- func (f *Flac) SetTag(field string, value []string) error
- func (f *Flac) SetTitle(title, version string) error
- func (f *Flac) SetTrackNumber(current, total string) error
- func (f *Flac) SetUPC(upc string) error
- func (f *Flac) String() string
- func (f *Flac) TotalPaddingSize() int
- func (f *Flac) Vendor() string
- type MetaDataBlockVorbisTags
- type Tags
Constants ¶
View Source
const ( // TagTitle Track/Work name TagTitle = "TITLE" // TagVersion The version field may be used to differentiate multiple versions of the same track title in a single collection. (e.g. remix info) TagVersion = "VERSION" // TagRemixer is the tracker remixer TagRemixer = "REMIXER" // TagAlbum The collection name to which this track belongs TagAlbum = "ALBUM" // TagArtist The artist generally considered responsible for the work. TagArtist = "ARTIST" // TagAlbumArtist is the main album artist TagAlbumArtist = "ALBUMARTIST" // TagTrackNumber The track number of this piece if part of a specific larger collection or album TagTrackNumber = "TRACKNUMBER" // TagDiscNumber is the disc number, for multi-disc releases TagDiscNumber = "DISCNUMBER" // TagDiscTotal is the total number of discs, for multi-disc releases TagDiscTotal = "DISCTOTAL" // TagDiscTotal2 is an alternative to DISCTOTAL TagDiscTotal2 = "TOTALDISCS" // TagTrackTotal is the total number of tracks for the current disc TagTrackTotal = "TRACKTOTAL" // TagTrackTotal2 is an alternative to TRACKTOTAL TagTrackTotal2 = "TOTALTRACKS" // TagPerformer The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. TagPerformer = "PERFORMER" // TagComposer is the composer (mainly for classical music) TagComposer = "COMPOSER" // TagAuthor is the author of the release TagAuthor = "AUTHOR" // TagConductor is the conductor (mainly for classical music) TagConductor = "CONDUCTOR" // TagMedia is the type of media (Digital WEB release, CD, etc) TagMedia = "MEDIA" // TagCopyright Copyright attribution TagCopyright = "COPYRIGHT" // TagLicense License information, eg, 'All Rights Reserved', 'Any Use Permitted', a URL to a license such as a Creative Commons license. TagLicense = "LICENSE" // TagRecordLabel Name of the organization producing the track (i.e. the 'record label') TagRecordLabel = "ORGANIZATION" // TagRecordLabel2 is an alternative for TagRecordLabel TagRecordLabel2 = "LABEL" // TagDescription A short text description of the contents TagDescription = "DESCRIPTION" // TagGenre A short text indication of music genre TagGenre = "GENRE" // TagDate Date the track was released TagDate = "DATE" // TagYear Year the track was released TagYear = "YEAR" // TagLocation Location where track was recorded TagLocation = "LOCATION" // TagContact Contact information for the creators or distributors of the track. TagContact = "CONTACT" // TagISRC ISRC number for the track. TagISRC = "ISRC" // TagUPC Universal Product Code for this release TagUPC = "UPC" // TagBarcode for this release TagBarcode = "BARCODE" // TagDuration of the track TagDuration = "DURATION" )
View Source
const (
FlacExt = ".flac"
)
Variables ¶
View Source
var ( ErrNoFlacHeader = errors.New("fLaC head incorrect, possibly because of id3v2 tags") ErrorUncompressed = errors.New("flac seems to be uncompressed") ErrorID3v1Tag = errors.New("id3v1 tag detected at end of file") ErrorMetadataSize = errors.New("excessive metadata blocks size") )
View Source
var ( ErrorNotVorbisComment = errors.New("not a vorbis comment metadata block") ErrorUnexpectedEof = errors.New("unexpected end of stream") ErrorInvalidFieldName = errors.New("malformed Field Name") ErrorID3v2Header = errors.New("found id3v2 tags, invalid FLAC file") ErrorFlacHeader = errors.New("invalid fLaC header") )
View Source
var ErrorMinimalTags = errors.New("missing minimal tag(s)")
Functions ¶
func CheckFLACHead ¶ added in v0.37.3
func IsValidTag ¶ added in v0.34.0
func OnlyKeepLettersAndNumbers ¶ added in v0.38.1
func SmartArtistList ¶
SmartArtistList returns a "a1, a2, & a3" list of artists.
func StringContainsStartOfAnother ¶ added in v0.38.1
Types ¶
type Flac ¶
type Flac struct { Path string OriginalVendor string SampleRate int BitDepth int SampleCount int64 DurationSeconds float32 Duration string Size int64 AverageBitRate int MD5 string HasCover bool CoverSize int // contains filtered or unexported fields }
func (*Flac) AddCoverFromBytes ¶ added in v0.33.0
AddCoverFromBytes assumes the cover is of valid size.
func (*Flac) CheckCompression ¶
func (*Flac) CheckDiscNumberInFilename ¶
func (*Flac) CheckFilenameContainsStartOfTitle ¶
func (*Flac) CheckForID3v1Tags ¶ added in v0.32.0
func (*Flac) CheckForMQAMetadata ¶ added in v0.38.0
func (*Flac) CheckForMQASyncword ¶ added in v0.38.0
func (*Flac) CheckMetadataSize ¶ added in v0.32.0
func (*Flac) CheckMinimalTags ¶ added in v0.38.3
func (*Flac) CheckNotCombinedTrackNumber ¶ added in v0.38.7
func (*Flac) CheckTrackNumberInFilename ¶
func (*Flac) ClearMetadata ¶
func (f *Flac) ClearMetadata()
func (*Flac) CommonTags ¶
func (*Flac) CompareBitDepth ¶
func (*Flac) CompareEncoding ¶
func (*Flac) CompareSampleRate ¶
func (*Flac) HasMinimalTags ¶
func (*Flac) OverwriteTags ¶
func (*Flac) SetAlbumArtists ¶
func (*Flac) SetDescription ¶
func (*Flac) SetDiscNumber ¶
func (*Flac) SetDuration ¶
func (*Flac) SetRecordLabel ¶
func (*Flac) SetReleaseDate ¶
func (*Flac) SetTrackNumber ¶
func (*Flac) TotalPaddingSize ¶ added in v0.32.0
type MetaDataBlockVorbisTags ¶
func NewTags ¶
func NewTags(vendor string) *MetaDataBlockVorbisTags
New creates a new MetaDataBlockVorbisTags.
func (*MetaDataBlockVorbisTags) Add ¶
func (c *MetaDataBlockVorbisTags) Add(key string, val string) error
Add adds a key-val pair to the comments.
func (*MetaDataBlockVorbisTags) Get ¶
func (c *MetaDataBlockVorbisTags) Get(key string) ([]string, error)
Get get all comments with field name specified by the key parameter.
func (MetaDataBlockVorbisTags) Marshal ¶
func (c MetaDataBlockVorbisTags) Marshal() (flac.MetaDataBlock, error)
Marshal marshals this block back into a flac.MetaDataBlock.
type Tags ¶
type Tags struct { TrackNumber string TotalTracks string DiscNumber string TotalDiscs string Artist []string AlbumArtist []string Performer []string Conductor []string Author []string Composer []string Remixer []string Guest []string Title string Description string Date string Year string Genre string Album string Label string Version string ISRC string UPC string Media string Duration string OtherTags map[string]string }
func (*Tags) SpecificTagsOnly ¶ added in v0.34.0
Click to show internal directories.
Click to hide internal directories.