tag

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

README

Build Status Go Report Card codecov

Tag

Its pure golang library for parsing and editing tags in mp3, mp4 and flac formats

Install

go get github.com/frolovo22/tag

For using command line arguments

go install github.com/frolovo22/tag

Supported tags

Name ID3v1 ID3v2.2 ID3v2.3 ID3v2.4 MP4 FLAC
Title Title TT2 TIT2 TIT2 \xa9nam TITLE
Artist Artist TP1 TPE1 TPE1 \xa9art ARTIST
Album Album TAL TALB TALB \xa9alb ALBUM
Year Year TYE TYER TDOR \xa9day YEAR
Comment Comment COM COMM COMM COMMENT
Genre Genre TCO TCON TCON \xa9gen GENRE
Album Artist - TOA TPE2 TPE2 aART ALBUMARTIST
Date - TIM TYER TDRC DATE
Arranger - - IPLS IPLS ARRANGER
Author - TOL TOLY TOLY AUTHOR
BPM - BPM TBPM TBPM BPM
Catalog Number - - TXXX:CATALOGNUMBER TXXX:CATALOGNUMBER CATALOGNUMBER
Compilation - - TCMP TCMP COMPILATION
Composer - TCM TCOM TCOM \xa9wrt COMPOSER
Conductor - TP3 TPE3 TPE3 CONDUCTOR
Copyright - TCR TCOP TCOP cprt COPYRIGHT
Description - TXX TIT3 TIT3 DESCRIPTION
Disc Number - - TPOS TPOS DISCNUMBER
Encoded by - TEN TENC TENC \xa9too ENCODED-BY
Track Number TrackNumber TRK TRCK TRCK trkn TRACKNUMBER
Picture - PIC APIC APIC covr METADATA_BLOCK_PICTURE

Status

In progress
Future features:

  • Support all tags (id3 v1, v1.1, v2.2, v2.3, v2.4, mp4, flac)
  • Fix errors in files (empty tags, incorrect size, tag size, tag parameters)
  • Command line arguments
Format Read Set Delete Save
idv1
  • - [x]
  • - [x]
  • - [x]
  • - [x]
idv1.1
  • - [x]
  • - [x]
  • - [x]
  • - [x]
idv2.2
  • - [x]
  • - [x]
  • - [x]
  • - [ ]
idv2.3
  • - [x]
  • - [x]
  • - [x]
  • - [x]
idv2.4
  • - [x]
  • - [x]
  • - [x]
  • - [x]
mp4
  • - [x]
  • - [ ]
  • - [ ]
  • - [ ]
FLAC
  • - [x]
  • - [x]
  • - [x]
  • - [x]

Command line arguments

Cli info

tag help

For read tags use

tag read -in "path/to/file"
# example output
version: id3v2.4
description         : subtitle
track number        : 12/12
author              : Kitten
catalog number      : catalogcat
bmp                 : 777
conductor           : catconductor
copyright           : 2019
album               : CatAlbum
comment             : catcomment

for save meta information use

tag read -in "path/to/file" -out "path/to/outputfile.json"

Now supported only json output file

How to use

tags, err := tag.ReadFile("song.mp3")
if err != nil {
return err
}
fmt.Println(tags.GetTitle())

tag.ReadFile or tag.Read return interface Metadata:

package tag

type Metadata interface {
	GetMetadata
	SetMetadata
	DeleteMetadata
	SaveMetadata
}

type GetMetadata interface {
	GetAllTagNames() []string
	GetVersion() Version
	GetFileData() []byte // all another file data

	GetTitle() (string, error)
	GetArtist() (string, error)
	GetAlbum() (string, error)
	GetYear() (int, error)
	GetComment() (string, error)
	GetGenre() (string, error)
	GetAlbumArtist() (string, error)
	GetDate() (time.Time, error)
	GetArranger() (string, error)
	GetAuthor() (string, error)
	GetBMP() (int, error)
	GetCatalogNumber() (int, error)
	GetCompilation() (string, error)
	GetComposer() (string, error)
	GetConductor() (string, error)
	GetCopyright() (string, error)
	GetDescription() (string, error)
	GetDiscNumber() (int, int, error) // number, total
	GetEncodedBy() (string, error)
	GetTrackNumber() (int, int, error) // number, total
	GetPicture() (image.Image, error)
}

type SetMetadata interface {
	SetTitle(title string) error
	SetArtist(artist string) error
	SetAlbum(album string) error
	SetYear(year int) error
	SetComment(comment string) error
	SetGenre(genre string) error
	SetAlbumArtist(albumArtist string) error
	SetDate(date time.Time) error
	SetArranger(arranger string) error
	SetAuthor(author string) error
	SetBMP(bmp int) error
	SetCatalogNumber(catalogNumber int) error
	SetCompilation(compilation string) error
	SetComposer(composer string) error
	SetConductor(conductor string) error
	SetCopyright(copyright string) error
	SetDescription(description string) error
	SetDiscNumber(number int, total int) error
	SetEncodedBy(encodedBy string) error
	SetTrackNumber(number int, total int) error
	SetPicture(picture image.Image) error
}

type DeleteMetadata interface {
	DeleteAll() error

	DeleteTitle() error
	DeleteArtist() error
	DeleteAlbum() error
	DeleteYear() error
	DeleteComment() error
	DeleteGenre() error
	DeleteAlbumArtist() error
	DeleteDate() error
	DeleteArranger() error
	DeleteAuthor() error
	DeleteBMP() error
	DeleteCatalogNumber() error
	DeleteCompilation() error
	DeleteComposer() error
	DeleteConductor() error
	DeleteCopyright() error
	DeleteDescription() error
	DeleteDiscNumber() error
	DeleteEncodedBy() error
	DeleteTrackNumber() error
	DeletePicture() error
}

type SaveMetadata interface {
	SaveFile(path string) error
	Save(input io.WriteSeeker) error
}

Also you can read defined format. For Example:

package main

import (
	"fmt"
	"github.com/ghenry22/tag"
	"os"
)

func Read() error {
	file, err := os.Open("path/to/file")
	if err != nil {
		return err
	}
	defer file.Close()

	id3v2, err := tag.ReadID3v24(file)
	if err != nil {
		return err
	}

	// Get tag value by name
	value, err := id3v2.GetString("TIT2")
	if err != nil {
		return err
	}
	fmt.Println("title: " + value)

	// Set tag value
	err = id3v2.SetString("TIT2", "Title")
	if err != nil {
		return err
	}

	// User defined tags
	value, err = id3v2.GetStringTXXX("MYTAG")
	if err != nil {
		return err
	}
	fmt.Println("my tag: " + value)

	// Set user tag
	err = id3v2.SetStringTXXX("MYTAG222", "Dogs")
	if err != nil {
		return err
	}

	// Save changes
	err = id3v2.SaveFile("path/to/file")
	if err != nil {
		return err
	}
}

Contribution

Documentation

Index

Constants

View Source
const Mp4Marker = "ftyp"
View Source
const Mp4MetaAtom = "meta"
View Source
const Mp4MetaIlst = "ilst"
View Source
const Mp4MetaUpta = "udta"
View Source
const Mp4MoovAtom = "moov"
View Source
const Mp4TagAlbum = "album"
View Source
const Mp4TagAlbumArtist = "album_artist"
View Source
const Mp4TagArtist = "artist"
View Source
const Mp4TagComment = "comment"
View Source
const Mp4TagCompilation = "compilation"
View Source
const Mp4TagComposer = "composer"
View Source
const Mp4TagCopyright = "copyright"
View Source
const Mp4TagDisc = "disk"
View Source
const Mp4TagEncoder = "encoder"
View Source
const Mp4TagGenre = "genre"
View Source
const Mp4TagGrouping = "grouping"
View Source
const Mp4TagKeyword = "keyword"
View Source
const Mp4TagLyrics = "lyrics"
View Source
const Mp4TagPicture = "picture"
View Source
const Mp4TagTempo = "tempo"
View Source
const Mp4TagTitle = "title"
View Source
const Mp4TagTrack = "track"
View Source
const Mp4TagYear = "year"

Variables

View Source
var (
	ErrUnsupportedFormat = errors.New("unsupported format")
	ErrIncorrectLength   = errors.New("tag incorrect length")
	ErrUnsupportedTag    = errors.New("unsupported tag")
	ErrTagNotFound       = errors.New("tag not found")
	ErrEmptyFile         = errors.New("empty file")
	ErrFileMarker        = errors.New("error file marker")
	ErrReadFile          = errors.New("error read file")
	ErrSeekFile          = errors.New("error seek file")
	ErrWriteFile         = errors.New("error write file")
	ErrIncorrectTag      = errors.New("incorrect tag")
	ErrNotFoundGenre     = errors.New("not found genre")
	ErrNotPictureBlock   = errors.New("not a picture block")
	ErrWriting           = errors.New("writing error")
	ErrDecodeEvenLength  = errors.New("must have even length byte slice")
	ErrEncodingFormat    = errors.New("unknown encoding format")
	ErrNotSupported      = errors.New("not supported")
)
View Source
var Mp4Types = [...]string{
	"mp41",
	"mp42",
	"isom",
	"iso2",
	"M4A ",
	"M4B ",
}

Functions

func ByteToInt

func ByteToInt(data []byte) int

Convert byte to int.

func ByteToIntSynchsafe

func ByteToIntSynchsafe(data []byte) int

ByteToIntSynchsafe - Convert byte to int In some parts of the tag it is inconvenient to use the unsychronisation scheme because the size of unsynchronised data is not known in advance, which is particularly problematic with size descriptors. The solution in ID3v2 is to use synchsafe integers, in which there can never be any false synchs. Synchsafe integers are integers that keep its highest bit (bit 7) zeroed, making seven bits out of eight available. Thus a 32 bit synchsafe integer can store 28 bits of information.

func DecodeString

func DecodeString(b []byte, encoding string) (string, error)

func DecodeUTF16

func DecodeUTF16(b []byte) (string, error)

Decode UTF-16 Little Endian to UTF-8.

func DecodeUTF16BE

func DecodeUTF16BE(b []byte) (string, error)

Decode UTF-16 Big Endian To UTF-8.

func GetBit

func GetBit(data byte, index byte) byte

Return bit value Index starts from 0 bits order [7,6,5,4,3,2,1,0].

func GetEncoding

func GetEncoding(code byte) string

func GetMap

func GetMap(metadata Metadata) map[string]interface{}

nolint:gocyclo

func GetString

func GetString(b []byte) (string, error)

func IntToByteSynchsafe

func IntToByteSynchsafe(data int) []byte

func SetBit

func SetBit(data *byte, bit bool, index byte)

func SetString

func SetString(value string) []byte

func SplitBytesWithTextDescription

func SplitBytesWithTextDescription(data []byte, encoding string) [][]byte

func TextEncoding

func TextEncoding(b []byte) string

TextEncoding - Text Encoding for text frame header First byte determinate text encoding. If ISO-8859-1 is used this byte should be $00, if Unicode is used it should be $01 Return text encoding. E.g. "utf8", "utf16", etc.

Types

type AttachedPicture

type AttachedPicture struct {
	MIME        string
	PictureType byte
	Description string
	Data        []byte
}

type DeleteMetadata

type DeleteMetadata interface {
	DeleteAll() error

	DeleteTitle() error
	DeleteArtist() error
	DeleteAlbum() error
	DeleteYear() error
	DeleteComment() error
	DeleteGenre() error
	DeleteAlbumArtist() error
	DeleteDate() error
	DeleteArranger() error
	DeleteAuthor() error
	DeleteBPM() error
	DeleteCatalogNumber() error
	DeleteCompilation() error
	DeleteComposer() error
	DeleteConductor() error
	DeleteCopyright() error
	DeleteDescription() error
	DeleteDiscNumber() error
	DeleteEncodedBy() error
	DeleteTrackNumber() error
	DeletePicture() error
}

type FLAC

type FLAC struct {
	Blocks []*FlacMetadataBlock

	// Vorbis Comment
	Vendor string
	Tags   map[string]string

	Data []byte
}

func ReadFLAC

func ReadFLAC(input io.ReadSeeker) (*FLAC, error)

func (*FLAC) DeleteAlbum

func (flac *FLAC) DeleteAlbum() error

func (*FLAC) DeleteAlbumArtist

func (flac *FLAC) DeleteAlbumArtist() error

func (*FLAC) DeleteAll

func (flac *FLAC) DeleteAll() error

func (*FLAC) DeleteArranger

func (flac *FLAC) DeleteArranger() error

func (*FLAC) DeleteArtist

func (flac *FLAC) DeleteArtist() error

func (*FLAC) DeleteAuthor

func (flac *FLAC) DeleteAuthor() error

func (*FLAC) DeleteBPM

func (flac *FLAC) DeleteBPM() error

func (*FLAC) DeleteCatalogNumber

func (flac *FLAC) DeleteCatalogNumber() error

func (*FLAC) DeleteComment

func (flac *FLAC) DeleteComment() error

func (*FLAC) DeleteCompilation

func (flac *FLAC) DeleteCompilation() error

func (*FLAC) DeleteComposer

func (flac *FLAC) DeleteComposer() error

func (*FLAC) DeleteConductor

func (flac *FLAC) DeleteConductor() error

func (*FLAC) DeleteCopyright

func (flac *FLAC) DeleteCopyright() error

func (*FLAC) DeleteDate

func (flac *FLAC) DeleteDate() error

func (*FLAC) DeleteDescription

func (flac *FLAC) DeleteDescription() error

func (*FLAC) DeleteDiscNumber

func (flac *FLAC) DeleteDiscNumber() error

func (*FLAC) DeleteEncodedBy

func (flac *FLAC) DeleteEncodedBy() error

func (*FLAC) DeleteGenre

func (flac *FLAC) DeleteGenre() error

func (*FLAC) DeletePicture

func (flac *FLAC) DeletePicture() error

func (*FLAC) DeleteTitle

func (flac *FLAC) DeleteTitle() error

func (*FLAC) DeleteTrackNumber

func (flac *FLAC) DeleteTrackNumber() error

func (*FLAC) DeleteYear

func (flac *FLAC) DeleteYear() error

func (*FLAC) GetAlbum

func (flac *FLAC) GetAlbum() (string, error)

func (*FLAC) GetAlbumArtist

func (flac *FLAC) GetAlbumArtist() (string, error)

func (*FLAC) GetAllTagNames

func (flac *FLAC) GetAllTagNames() []string

func (*FLAC) GetArranger

func (flac *FLAC) GetArranger() (string, error)

func (*FLAC) GetArtist

func (flac *FLAC) GetArtist() (string, error)

func (*FLAC) GetAuthor

func (flac *FLAC) GetAuthor() (string, error)

func (*FLAC) GetBPM

func (flac *FLAC) GetBPM() (int, error)

func (*FLAC) GetCatalogNumber

func (flac *FLAC) GetCatalogNumber() (string, error)

func (*FLAC) GetComment

func (flac *FLAC) GetComment() (string, error)

func (*FLAC) GetCompilation

func (flac *FLAC) GetCompilation() (string, error)

func (*FLAC) GetComposer

func (flac *FLAC) GetComposer() (string, error)

func (*FLAC) GetConductor

func (flac *FLAC) GetConductor() (string, error)

func (*FLAC) GetCopyright

func (flac *FLAC) GetCopyright() (string, error)

func (*FLAC) GetDate

func (flac *FLAC) GetDate() (time.Time, error)

func (*FLAC) GetDescription

func (flac *FLAC) GetDescription() (string, error)

func (*FLAC) GetDiscNumber

func (flac *FLAC) GetDiscNumber() (int, int, error)

func (*FLAC) GetEncodedBy

func (flac *FLAC) GetEncodedBy() (string, error)

func (*FLAC) GetFileData

func (flac *FLAC) GetFileData() []byte

func (*FLAC) GetGenre

func (flac *FLAC) GetGenre() (string, error)

func (*FLAC) GetMetadataBlockPicture

func (flac *FLAC) GetMetadataBlockPicture() (*FlacMetadataBlockPicture, error)

func (*FLAC) GetPicture

func (flac *FLAC) GetPicture() (image.Image, error)

func (*FLAC) GetTitle

func (flac *FLAC) GetTitle() (string, error)

func (*FLAC) GetTrackNumber

func (flac *FLAC) GetTrackNumber() (int, int, error)

func (*FLAC) GetVersion

func (flac *FLAC) GetVersion() Version

func (*FLAC) GetVorbisComment

func (flac *FLAC) GetVorbisComment(key string) (string, error)

func (*FLAC) GetVorbisCommentInt

func (flac *FLAC) GetVorbisCommentInt(key string) (int, error)

func (*FLAC) GetVorbisCommentTime

func (flac *FLAC) GetVorbisCommentTime(key string) (time.Time, error)

func (*FLAC) GetYear

func (flac *FLAC) GetYear() (int, error)

func (*FLAC) Save

func (flac *FLAC) Save(input io.WriteSeeker) error

func (*FLAC) SaveFile

func (flac *FLAC) SaveFile(path string) error

func (*FLAC) SetAlbum

func (flac *FLAC) SetAlbum(album string) error

func (*FLAC) SetAlbumArtist

func (flac *FLAC) SetAlbumArtist(albumArtist string) error

func (*FLAC) SetArranger

func (flac *FLAC) SetArranger(arranger string) error

func (*FLAC) SetArtist

func (flac *FLAC) SetArtist(artist string) error

func (*FLAC) SetAuthor

func (flac *FLAC) SetAuthor(author string) error

func (*FLAC) SetBPM

func (flac *FLAC) SetBPM(bmp int) error

func (*FLAC) SetCatalogNumber

func (flac *FLAC) SetCatalogNumber(catalogNumber string) error

func (*FLAC) SetComment

func (flac *FLAC) SetComment(comment string) error

func (*FLAC) SetCompilation

func (flac *FLAC) SetCompilation(compilation string) error

func (*FLAC) SetComposer

func (flac *FLAC) SetComposer(composer string) error

func (*FLAC) SetConductor

func (flac *FLAC) SetConductor(conductor string) error

func (*FLAC) SetCopyright

func (flac *FLAC) SetCopyright(copyright string) error

func (*FLAC) SetDate

func (flac *FLAC) SetDate(date time.Time) error

func (*FLAC) SetDescription

func (flac *FLAC) SetDescription(description string) error

func (*FLAC) SetDiscNumber

func (flac *FLAC) SetDiscNumber(number int, total int) error

func (*FLAC) SetEncodedBy

func (flac *FLAC) SetEncodedBy(encodedBy string) error

func (*FLAC) SetGenre

func (flac *FLAC) SetGenre(genre string) error

func (*FLAC) SetPicture

func (flac *FLAC) SetPicture(picture image.Image) error

func (*FLAC) SetTitle

func (flac *FLAC) SetTitle(title string) error

func (*FLAC) SetTrackNumber

func (flac *FLAC) SetTrackNumber(number int, total int) error

func (*FLAC) SetYear

func (flac *FLAC) SetYear(year int) error

type FlacMetadataBlock

type FlacMetadataBlock struct {
	// IsLast - Last-metadata-block flag:
	// '1' if this block is the last metadata block before the audio blocks,
	// '0' otherwise.
	IsLast bool
	Type   FlacMetadataBlockType
	Size   int
	Data   []byte
}

func (*FlacMetadataBlock) Write

func (block *FlacMetadataBlock) Write(w io.Writer, isLast bool) error

type FlacMetadataBlockPicture

type FlacMetadataBlockPicture struct {
	Type           int32
	MIME           string
	Description    string
	Width          int32
	Height         int32
	BitsPerPixel   int32
	NumberOfColors int32
	PictureData    []byte
}

type FlacMetadataBlockType

type FlacMetadataBlockType byte
const (
	FlacStreamInfo    FlacMetadataBlockType = 0
	FlacPadding       FlacMetadataBlockType = 1
	FlacApplication   FlacMetadataBlockType = 2
	FlacSeekTable     FlacMetadataBlockType = 3
	FlacVorbisComment FlacMetadataBlockType = 4
	FlacCueSheet      FlacMetadataBlockType = 5
	FlacPicture       FlacMetadataBlockType = 6
)

BLOCK_TYPE:

0 : STREAMINFO
1 : PADDING
2 : APPLICATION
3 : SEEKTABLE
4 : VORBIS_COMMENT
5 : CUESHEET
6 : PICTURE
7-126 : reserved
127 : invalid, to avoid confusion with a frame sync code

type Genre

type Genre byte

func GetGenreByName

func GetGenreByName(name string) (Genre, error)

func (Genre) String

func (g Genre) String() string

type GetMetadata

type GetMetadata interface {
	GetAllTagNames() []string
	GetVersion() Version
	GetFileData() []byte // all another file data

	GetTitle() (string, error)
	GetArtist() (string, error)
	GetAlbum() (string, error)
	GetYear() (int, error)
	GetComment() (string, error)
	GetGenre() (string, error)
	GetAlbumArtist() (string, error)
	GetDate() (time.Time, error)
	GetArranger() (string, error)
	GetAuthor() (string, error)
	GetBPM() (int, error)
	GetCatalogNumber() (string, error)
	GetCompilation() (string, error)
	GetComposer() (string, error)
	GetConductor() (string, error)
	GetCopyright() (string, error)
	GetDescription() (string, error)
	GetDiscNumber() (int, int, error) // number, total
	GetEncodedBy() (string, error)
	GetTrackNumber() (int, int, error) // number, total
	GetPicture() (image.Image, error)
}

type ID3v1

type ID3v1 struct {
	Type     string // Always 'TAG'
	Title    string // length 30. 30 characters of the title
	Artist   string // length 30. 30 characters of the artist name
	Album    string // length 30. 30 characters of the album name
	Year     int    // length 4. A four-digit year.
	Comment  string // length 28 or 30. The comment.
	ZeroByte byte   // length 1. If a track number is stored, this byte contains a binary 0.
	Track    byte   // length 1. The number of the track on the album, or 0. Invalid, if previous byte is not a binary 0.
	Genre    Genre  // length 1. Index in a list of genres, or 255

	// another file data
	Data []byte
}

ID3v1 - struct for store id3v1 data format with fix size - 128 bytes.

func ReadID3v1

func ReadID3v1(input io.ReadSeeker) (*ID3v1, error)

func (*ID3v1) DeleteAlbum

func (id3v1 *ID3v1) DeleteAlbum() error

func (*ID3v1) DeleteAlbumArtist

func (id3v1 *ID3v1) DeleteAlbumArtist() error

func (*ID3v1) DeleteAll

func (id3v1 *ID3v1) DeleteAll() error

func (*ID3v1) DeleteArranger

func (id3v1 *ID3v1) DeleteArranger() error

func (*ID3v1) DeleteArtist

func (id3v1 *ID3v1) DeleteArtist() error

func (*ID3v1) DeleteAuthor

func (id3v1 *ID3v1) DeleteAuthor() error

func (*ID3v1) DeleteBPM

func (id3v1 *ID3v1) DeleteBPM() error

func (*ID3v1) DeleteCatalogNumber

func (id3v1 *ID3v1) DeleteCatalogNumber() error

func (*ID3v1) DeleteComment

func (id3v1 *ID3v1) DeleteComment() error

func (*ID3v1) DeleteCompilation

func (id3v1 *ID3v1) DeleteCompilation() error

func (*ID3v1) DeleteComposer

func (id3v1 *ID3v1) DeleteComposer() error

func (*ID3v1) DeleteConductor

func (id3v1 *ID3v1) DeleteConductor() error

func (*ID3v1) DeleteCopyright

func (id3v1 *ID3v1) DeleteCopyright() error

func (*ID3v1) DeleteDate

func (id3v1 *ID3v1) DeleteDate() error

func (*ID3v1) DeleteDescription

func (id3v1 *ID3v1) DeleteDescription() error

func (*ID3v1) DeleteDiscNumber

func (id3v1 *ID3v1) DeleteDiscNumber() error

func (*ID3v1) DeleteEncodedBy

func (id3v1 *ID3v1) DeleteEncodedBy() error

func (*ID3v1) DeleteGenre

func (id3v1 *ID3v1) DeleteGenre() error

func (*ID3v1) DeletePicture

func (id3v1 *ID3v1) DeletePicture() error

func (*ID3v1) DeleteTitle

func (id3v1 *ID3v1) DeleteTitle() error

func (*ID3v1) DeleteTrackNumber

func (id3v1 *ID3v1) DeleteTrackNumber() error

func (*ID3v1) DeleteYear

func (id3v1 *ID3v1) DeleteYear() error

func (*ID3v1) GetAlbum

func (id3v1 *ID3v1) GetAlbum() (string, error)

func (*ID3v1) GetAlbumArtist

func (id3v1 *ID3v1) GetAlbumArtist() (string, error)

func (*ID3v1) GetAllTagNames

func (id3v1 *ID3v1) GetAllTagNames() []string

func (*ID3v1) GetArranger

func (id3v1 *ID3v1) GetArranger() (string, error)

func (*ID3v1) GetArtist

func (id3v1 *ID3v1) GetArtist() (string, error)

func (*ID3v1) GetAuthor

func (id3v1 *ID3v1) GetAuthor() (string, error)

func (*ID3v1) GetBPM

func (id3v1 *ID3v1) GetBPM() (int, error)

func (*ID3v1) GetCatalogNumber

func (id3v1 *ID3v1) GetCatalogNumber() (string, error)

func (*ID3v1) GetComment

func (id3v1 *ID3v1) GetComment() (string, error)

func (*ID3v1) GetCompilation

func (id3v1 *ID3v1) GetCompilation() (string, error)

func (*ID3v1) GetComposer

func (id3v1 *ID3v1) GetComposer() (string, error)

func (*ID3v1) GetConductor

func (id3v1 *ID3v1) GetConductor() (string, error)

func (*ID3v1) GetCopyright

func (id3v1 *ID3v1) GetCopyright() (string, error)

func (*ID3v1) GetDate

func (id3v1 *ID3v1) GetDate() (time.Time, error)

func (*ID3v1) GetDescription

func (id3v1 *ID3v1) GetDescription() (string, error)

func (*ID3v1) GetDiscNumber

func (id3v1 *ID3v1) GetDiscNumber() (int, int, error)

func (*ID3v1) GetEncodedBy

func (id3v1 *ID3v1) GetEncodedBy() (string, error)

func (*ID3v1) GetFileData

func (id3v1 *ID3v1) GetFileData() []byte

func (*ID3v1) GetGenre

func (id3v1 *ID3v1) GetGenre() (string, error)

func (*ID3v1) GetPicture

func (id3v1 *ID3v1) GetPicture() (image.Image, error)

func (*ID3v1) GetTitle

func (id3v1 *ID3v1) GetTitle() (string, error)

func (*ID3v1) GetTrackNumber

func (id3v1 *ID3v1) GetTrackNumber() (int, int, error)

func (*ID3v1) GetVersion

func (id3v1 *ID3v1) GetVersion() Version

func (*ID3v1) GetYear

func (id3v1 *ID3v1) GetYear() (int, error)

func (*ID3v1) Save

func (id3v1 *ID3v1) Save(input io.WriteSeeker) error

func (*ID3v1) SaveFile

func (id3v1 *ID3v1) SaveFile(path string) error

func (*ID3v1) SetAlbum

func (id3v1 *ID3v1) SetAlbum(album string) error

func (*ID3v1) SetAlbumArtist

func (id3v1 *ID3v1) SetAlbumArtist(albumArtist string) error

func (*ID3v1) SetArranger

func (id3v1 *ID3v1) SetArranger(arranger string) error

func (*ID3v1) SetArtist

func (id3v1 *ID3v1) SetArtist(artist string) error

func (*ID3v1) SetAuthor

func (id3v1 *ID3v1) SetAuthor(author string) error

func (*ID3v1) SetBPM

func (id3v1 *ID3v1) SetBPM(bmp int) error

func (*ID3v1) SetCatalogNumber

func (id3v1 *ID3v1) SetCatalogNumber(catalogNumber string) error

func (*ID3v1) SetComment

func (id3v1 *ID3v1) SetComment(comment string) error

func (*ID3v1) SetCompilation

func (id3v1 *ID3v1) SetCompilation(compilation string) error

func (*ID3v1) SetComposer

func (id3v1 *ID3v1) SetComposer(composer string) error

func (*ID3v1) SetConductor

func (id3v1 *ID3v1) SetConductor(conductor string) error

func (*ID3v1) SetCopyright

func (id3v1 *ID3v1) SetCopyright(copyright string) error

func (*ID3v1) SetDate

func (id3v1 *ID3v1) SetDate(date time.Time) error

func (*ID3v1) SetDescription

func (id3v1 *ID3v1) SetDescription(description string) error

func (*ID3v1) SetDiscNumber

func (id3v1 *ID3v1) SetDiscNumber(number int, total int) error

func (*ID3v1) SetEncodedBy

func (id3v1 *ID3v1) SetEncodedBy(encodedBy string) error

func (*ID3v1) SetGenre

func (id3v1 *ID3v1) SetGenre(genre string) error

func (*ID3v1) SetPicture

func (id3v1 *ID3v1) SetPicture(picture image.Image) error

func (*ID3v1) SetTitle

func (id3v1 *ID3v1) SetTitle(title string) error

func (*ID3v1) SetTrackNumber

func (id3v1 *ID3v1) SetTrackNumber(number int, total int) error

func (*ID3v1) SetYear

func (id3v1 *ID3v1) SetYear(year int) error

func (*ID3v1) String

func (id3v1 *ID3v1) String() string

type ID3v22

type ID3v22 struct {
	Marker     string // Always 'ID3'
	Version    Version
	SubVersion int
	Flags      id3v22Flags
	Length     int
	Frames     []ID3v22Frame

	Data []byte
}

func ReadID3v22

func ReadID3v22(input io.ReadSeeker) (*ID3v22, error)

nolint:gocyclo

func (*ID3v22) DeleteAlbum

func (id3v2 *ID3v22) DeleteAlbum() error

func (*ID3v22) DeleteAlbumArtist

func (id3v2 *ID3v22) DeleteAlbumArtist() error

func (*ID3v22) DeleteAll

func (id3v2 *ID3v22) DeleteAll() error

func (*ID3v22) DeleteArranger

func (id3v2 *ID3v22) DeleteArranger() error

func (*ID3v22) DeleteArtist

func (id3v2 *ID3v22) DeleteArtist() error

func (*ID3v22) DeleteAuthor

func (id3v2 *ID3v22) DeleteAuthor() error

func (*ID3v22) DeleteBPM

func (id3v2 *ID3v22) DeleteBPM() error

func (*ID3v22) DeleteCatalogNumber

func (id3v2 *ID3v22) DeleteCatalogNumber() error

func (*ID3v22) DeleteComment

func (id3v2 *ID3v22) DeleteComment() error

func (*ID3v22) DeleteCompilation

func (id3v2 *ID3v22) DeleteCompilation() error

func (*ID3v22) DeleteComposer

func (id3v2 *ID3v22) DeleteComposer() error

func (*ID3v22) DeleteConductor

func (id3v2 *ID3v22) DeleteConductor() error

func (*ID3v22) DeleteCopyright

func (id3v2 *ID3v22) DeleteCopyright() error

func (*ID3v22) DeleteDate

func (id3v2 *ID3v22) DeleteDate() error

func (*ID3v22) DeleteDescription

func (id3v2 *ID3v22) DeleteDescription() error

func (*ID3v22) DeleteDiscNumber

func (id3v2 *ID3v22) DeleteDiscNumber() error

func (*ID3v22) DeleteEncodedBy

func (id3v2 *ID3v22) DeleteEncodedBy() error

func (*ID3v22) DeleteGenre

func (id3v2 *ID3v22) DeleteGenre() error

func (*ID3v22) DeletePicture

func (id3v2 *ID3v22) DeletePicture() error

func (*ID3v22) DeleteTitle

func (id3v2 *ID3v22) DeleteTitle() error

func (*ID3v22) DeleteTrackNumber

func (id3v2 *ID3v22) DeleteTrackNumber() error

func (*ID3v22) DeleteYear

func (id3v2 *ID3v22) DeleteYear() error

func (*ID3v22) GetAlbum

func (id3v2 *ID3v22) GetAlbum() (string, error)

func (*ID3v22) GetAlbumArtist

func (id3v2 *ID3v22) GetAlbumArtist() (string, error)

func (*ID3v22) GetAllTagNames

func (id3v2 *ID3v22) GetAllTagNames() []string

func (*ID3v22) GetArranger

func (id3v2 *ID3v22) GetArranger() (string, error)

func (*ID3v22) GetArtist

func (id3v2 *ID3v22) GetArtist() (string, error)

func (*ID3v22) GetAttachedPicture

func (id3v2 *ID3v22) GetAttachedPicture() (*AttachedPicture, error)

func (*ID3v22) GetAuthor

func (id3v2 *ID3v22) GetAuthor() (string, error)

func (*ID3v22) GetBPM

func (id3v2 *ID3v22) GetBPM() (int, error)

func (*ID3v22) GetBytes

func (id3v2 *ID3v22) GetBytes(name string) ([]byte, error)

func (*ID3v22) GetCatalogNumber

func (id3v2 *ID3v22) GetCatalogNumber() (string, error)

func (*ID3v22) GetComment

func (id3v2 *ID3v22) GetComment() (string, error)

func (*ID3v22) GetCompilation

func (id3v2 *ID3v22) GetCompilation() (string, error)

func (*ID3v22) GetComposer

func (id3v2 *ID3v22) GetComposer() (string, error)

func (*ID3v22) GetConductor

func (id3v2 *ID3v22) GetConductor() (string, error)

func (*ID3v22) GetCopyright

func (id3v2 *ID3v22) GetCopyright() (string, error)

func (*ID3v22) GetDate

func (id3v2 *ID3v22) GetDate() (time.Time, error)

func (*ID3v22) GetDescription

func (id3v2 *ID3v22) GetDescription() (string, error)

func (*ID3v22) GetDiscNumber

func (id3v2 *ID3v22) GetDiscNumber() (int, int, error)

func (*ID3v22) GetEncodedBy

func (id3v2 *ID3v22) GetEncodedBy() (string, error)

func (*ID3v22) GetFileData

func (id3v2 *ID3v22) GetFileData() []byte

func (*ID3v22) GetGenre

func (id3v2 *ID3v22) GetGenre() (string, error)

func (*ID3v22) GetPicture

func (id3v2 *ID3v22) GetPicture() (image.Image, error)

func (*ID3v22) GetString

func (id3v2 *ID3v22) GetString(name string) (string, error)

func (*ID3v22) GetTitle

func (id3v2 *ID3v22) GetTitle() (string, error)

func (*ID3v22) GetTrackNumber

func (id3v2 *ID3v22) GetTrackNumber() (int, int, error)

func (*ID3v22) GetVersion

func (id3v2 *ID3v22) GetVersion() Version

func (*ID3v22) GetYear

func (id3v2 *ID3v22) GetYear() (int, error)

func (*ID3v22) Save

func (id3v2 *ID3v22) Save(input io.WriteSeeker) error

func (*ID3v22) SaveFile

func (id3v2 *ID3v22) SaveFile(path string) error

func (*ID3v22) SetAlbum

func (id3v2 *ID3v22) SetAlbum(album string) error

func (*ID3v22) SetAlbumArtist

func (id3v2 *ID3v22) SetAlbumArtist(albumArtist string) error

func (*ID3v22) SetArranger

func (id3v2 *ID3v22) SetArranger(arranger string) error

func (*ID3v22) SetArtist

func (id3v2 *ID3v22) SetArtist(artist string) error

func (*ID3v22) SetAuthor

func (id3v2 *ID3v22) SetAuthor(author string) error

func (*ID3v22) SetBPM

func (id3v2 *ID3v22) SetBPM(bmp int) error

func (*ID3v22) SetCatalogNumber

func (id3v2 *ID3v22) SetCatalogNumber(catalogNumber string) error

func (*ID3v22) SetComment

func (id3v2 *ID3v22) SetComment(comment string) error

func (*ID3v22) SetCompilation

func (id3v2 *ID3v22) SetCompilation(compilation string) error

func (*ID3v22) SetComposer

func (id3v2 *ID3v22) SetComposer(composer string) error

func (*ID3v22) SetConductor

func (id3v2 *ID3v22) SetConductor(conductor string) error

func (*ID3v22) SetCopyright

func (id3v2 *ID3v22) SetCopyright(copyright string) error

func (*ID3v22) SetDate

func (id3v2 *ID3v22) SetDate(date time.Time) error

func (*ID3v22) SetDescription

func (id3v2 *ID3v22) SetDescription(description string) error

func (*ID3v22) SetDiscNumber

func (id3v2 *ID3v22) SetDiscNumber(number int, total int) error

func (*ID3v22) SetEncodedBy

func (id3v2 *ID3v22) SetEncodedBy(encodedBy string) error

func (*ID3v22) SetGenre

func (id3v2 *ID3v22) SetGenre(genre string) error

func (*ID3v22) SetPicture

func (id3v2 *ID3v22) SetPicture(picture image.Image) error

func (*ID3v22) SetTitle

func (id3v2 *ID3v22) SetTitle(title string) error

func (*ID3v22) SetTrackNumber

func (id3v2 *ID3v22) SetTrackNumber(number int, total int) error

func (*ID3v22) SetYear

func (id3v2 *ID3v22) SetYear(year int) error

type ID3v22Frame

type ID3v22Frame struct {
	Key   string
	Value []byte
}

type ID3v23

type ID3v23 struct {
	Marker     string // Always 'ID3'
	Version    Version
	SubVersion int
	Flags      id3v23Flags
	Length     int
	Frames     []ID3v23Frame

	Data []byte
}

func ReadID3v23

func ReadID3v23(input io.ReadSeeker) (*ID3v23, error)

nolint:funlen

func (*ID3v23) DeleteAlbum

func (id3v2 *ID3v23) DeleteAlbum() error

func (*ID3v23) DeleteAlbumArtist

func (id3v2 *ID3v23) DeleteAlbumArtist() error

func (*ID3v23) DeleteAll

func (id3v2 *ID3v23) DeleteAll() error

func (*ID3v23) DeleteArranger

func (id3v2 *ID3v23) DeleteArranger() error

func (*ID3v23) DeleteArtist

func (id3v2 *ID3v23) DeleteArtist() error

func (*ID3v23) DeleteAuthor

func (id3v2 *ID3v23) DeleteAuthor() error

func (*ID3v23) DeleteBPM

func (id3v2 *ID3v23) DeleteBPM() error

func (*ID3v23) DeleteCatalogNumber

func (id3v2 *ID3v23) DeleteCatalogNumber() error

func (*ID3v23) DeleteComment

func (id3v2 *ID3v23) DeleteComment() error

func (*ID3v23) DeleteCompilation

func (id3v2 *ID3v23) DeleteCompilation() error

func (*ID3v23) DeleteComposer

func (id3v2 *ID3v23) DeleteComposer() error

func (*ID3v23) DeleteConductor

func (id3v2 *ID3v23) DeleteConductor() error

func (*ID3v23) DeleteCopyright

func (id3v2 *ID3v23) DeleteCopyright() error

func (*ID3v23) DeleteDate

func (id3v2 *ID3v23) DeleteDate() error

func (*ID3v23) DeleteDescription

func (id3v2 *ID3v23) DeleteDescription() error

func (*ID3v23) DeleteDiscNumber

func (id3v2 *ID3v23) DeleteDiscNumber() error

func (*ID3v23) DeleteEncodedBy

func (id3v2 *ID3v23) DeleteEncodedBy() error

func (*ID3v23) DeleteGenre

func (id3v2 *ID3v23) DeleteGenre() error

func (*ID3v23) DeletePicture

func (id3v2 *ID3v23) DeletePicture() error

func (*ID3v23) DeleteTag

func (id3v2 *ID3v23) DeleteTag(name string) error

func (*ID3v23) DeleteTagTXXX

func (id3v2 *ID3v23) DeleteTagTXXX(name string) error

func (*ID3v23) DeleteTitle

func (id3v2 *ID3v23) DeleteTitle() error

func (*ID3v23) DeleteTrackNumber

func (id3v2 *ID3v23) DeleteTrackNumber() error

func (*ID3v23) DeleteYear

func (id3v2 *ID3v23) DeleteYear() error

func (*ID3v23) GetAlbum

func (id3v2 *ID3v23) GetAlbum() (string, error)

func (*ID3v23) GetAlbumArtist

func (id3v2 *ID3v23) GetAlbumArtist() (string, error)

func (*ID3v23) GetAllTagNames

func (id3v2 *ID3v23) GetAllTagNames() []string

func (*ID3v23) GetArranger

func (id3v2 *ID3v23) GetArranger() (string, error)

func (*ID3v23) GetArtist

func (id3v2 *ID3v23) GetArtist() (string, error)

func (*ID3v23) GetAttachedPicture

func (id3v2 *ID3v23) GetAttachedPicture() (*AttachedPicture, error)

func (*ID3v23) GetAuthor

func (id3v2 *ID3v23) GetAuthor() (string, error)

func (*ID3v23) GetBPM

func (id3v2 *ID3v23) GetBPM() (int, error)

func (*ID3v23) GetCatalogNumber

func (id3v2 *ID3v23) GetCatalogNumber() (string, error)

func (*ID3v23) GetComment

func (id3v2 *ID3v23) GetComment() (string, error)

func (*ID3v23) GetCompilation

func (id3v2 *ID3v23) GetCompilation() (string, error)

func (*ID3v23) GetComposer

func (id3v2 *ID3v23) GetComposer() (string, error)

func (*ID3v23) GetConductor

func (id3v2 *ID3v23) GetConductor() (string, error)

func (*ID3v23) GetCopyright

func (id3v2 *ID3v23) GetCopyright() (string, error)

func (*ID3v23) GetDate

func (id3v2 *ID3v23) GetDate() (time.Time, error)

func (*ID3v23) GetDescription

func (id3v2 *ID3v23) GetDescription() (string, error)

func (*ID3v23) GetDiscNumber

func (id3v2 *ID3v23) GetDiscNumber() (int, int, error)

func (*ID3v23) GetEncodedBy

func (id3v2 *ID3v23) GetEncodedBy() (string, error)

func (*ID3v23) GetFileData

func (id3v2 *ID3v23) GetFileData() []byte

func (*ID3v23) GetGenre

func (id3v2 *ID3v23) GetGenre() (string, error)

func (*ID3v23) GetInt

func (id3v2 *ID3v23) GetInt(name string) (int, error)

func (*ID3v23) GetIntTXXX

func (id3v2 *ID3v23) GetIntTXXX(name string) (int, error)

func (*ID3v23) GetPicture

func (id3v2 *ID3v23) GetPicture() (image.Image, error)

func (*ID3v23) GetString

func (id3v2 *ID3v23) GetString(name string) (string, error)

func (*ID3v23) GetStringTXXX

func (id3v2 *ID3v23) GetStringTXXX(name string) (string, error)

GetStringTXXX - read TXXX frame Header for 'User defined text information frame' Text encoding $xx Description <text string according to encoding> $00 (00) Value <text string according to encoding>.

func (*ID3v23) GetTimestamp

func (id3v2 *ID3v23) GetTimestamp(name string) (time.Time, error)

func (*ID3v23) GetTitle

func (id3v2 *ID3v23) GetTitle() (string, error)

func (*ID3v23) GetTrackNumber

func (id3v2 *ID3v23) GetTrackNumber() (int, int, error)

func (*ID3v23) GetVersion

func (id3v2 *ID3v23) GetVersion() Version

func (*ID3v23) GetYear

func (id3v2 *ID3v23) GetYear() (int, error)

func (*ID3v23) Save

func (id3v2 *ID3v23) Save(input io.WriteSeeker) error

func (*ID3v23) SaveFile

func (id3v2 *ID3v23) SaveFile(path string) error

func (*ID3v23) SetAlbum

func (id3v2 *ID3v23) SetAlbum(album string) error

func (*ID3v23) SetAlbumArtist

func (id3v2 *ID3v23) SetAlbumArtist(albumArtist string) error

func (*ID3v23) SetArranger

func (id3v2 *ID3v23) SetArranger(arranger string) error

func (*ID3v23) SetArtist

func (id3v2 *ID3v23) SetArtist(artist string) error

func (*ID3v23) SetAttachedPicture

func (id3v2 *ID3v23) SetAttachedPicture(picture *AttachedPicture) error

nolint:gocritic

func (*ID3v23) SetAuthor

func (id3v2 *ID3v23) SetAuthor(author string) error

func (*ID3v23) SetBPM

func (id3v2 *ID3v23) SetBPM(bmp int) error

func (*ID3v23) SetCatalogNumber

func (id3v2 *ID3v23) SetCatalogNumber(catalogNumber string) error

func (*ID3v23) SetComment

func (id3v2 *ID3v23) SetComment(comment string) error

func (*ID3v23) SetCompilation

func (id3v2 *ID3v23) SetCompilation(compilation string) error

func (*ID3v23) SetComposer

func (id3v2 *ID3v23) SetComposer(composer string) error

func (*ID3v23) SetConductor

func (id3v2 *ID3v23) SetConductor(conductor string) error

func (*ID3v23) SetCopyright

func (id3v2 *ID3v23) SetCopyright(copyright string) error

func (*ID3v23) SetDate

func (id3v2 *ID3v23) SetDate(date time.Time) error

func (*ID3v23) SetDescription

func (id3v2 *ID3v23) SetDescription(description string) error

func (*ID3v23) SetDiscNumber

func (id3v2 *ID3v23) SetDiscNumber(number int, total int) error

func (*ID3v23) SetEncodedBy

func (id3v2 *ID3v23) SetEncodedBy(encodedBy string) error

func (*ID3v23) SetGenre

func (id3v2 *ID3v23) SetGenre(genre string) error

func (*ID3v23) SetInt

func (id3v2 *ID3v23) SetInt(name string, value int) error

func (*ID3v23) SetPicture

func (id3v2 *ID3v23) SetPicture(picture image.Image) error

func (*ID3v23) SetString

func (id3v2 *ID3v23) SetString(name string, value string) error

func (*ID3v23) SetStringTXXX

func (id3v2 *ID3v23) SetStringTXXX(name string, value string) error

func (*ID3v23) SetTimestamp

func (id3v2 *ID3v23) SetTimestamp(name string, value time.Time) error

func (*ID3v23) SetTitle

func (id3v2 *ID3v23) SetTitle(title string) error

func (*ID3v23) SetTrackNumber

func (id3v2 *ID3v23) SetTrackNumber(number int, total int) error

func (*ID3v23) SetYear

func (id3v2 *ID3v23) SetYear(year int) error

func (*ID3v23) String

func (id3v2 *ID3v23) String() string

type ID3v23Frame

type ID3v23Frame struct {
	Key   string
	Value []byte
}

type ID3v24

type ID3v24 struct {
	Marker     string // Always 'ID3'
	Version    Version
	SubVersion int
	Flags      id3v24Flags
	Length     int
	Frames     []ID3v24Frame

	Data []byte
}

func ReadID3v24

func ReadID3v24(input io.ReadSeeker) (*ID3v24, error)

func (*ID3v24) DeleteAlbum

func (id3v2 *ID3v24) DeleteAlbum() error

func (*ID3v24) DeleteAlbumArtist

func (id3v2 *ID3v24) DeleteAlbumArtist() error

func (*ID3v24) DeleteAll

func (id3v2 *ID3v24) DeleteAll() error

func (*ID3v24) DeleteArranger

func (id3v2 *ID3v24) DeleteArranger() error

func (*ID3v24) DeleteArtist

func (id3v2 *ID3v24) DeleteArtist() error

func (*ID3v24) DeleteAuthor

func (id3v2 *ID3v24) DeleteAuthor() error

func (*ID3v24) DeleteBPM

func (id3v2 *ID3v24) DeleteBPM() error

func (*ID3v24) DeleteCatalogNumber

func (id3v2 *ID3v24) DeleteCatalogNumber() error

func (*ID3v24) DeleteComment

func (id3v2 *ID3v24) DeleteComment() error

func (*ID3v24) DeleteCompilation

func (id3v2 *ID3v24) DeleteCompilation() error

func (*ID3v24) DeleteComposer

func (id3v2 *ID3v24) DeleteComposer() error

func (*ID3v24) DeleteConductor

func (id3v2 *ID3v24) DeleteConductor() error

func (*ID3v24) DeleteCopyright

func (id3v2 *ID3v24) DeleteCopyright() error

func (*ID3v24) DeleteDate

func (id3v2 *ID3v24) DeleteDate() error

func (*ID3v24) DeleteDescription

func (id3v2 *ID3v24) DeleteDescription() error

func (*ID3v24) DeleteDiscNumber

func (id3v2 *ID3v24) DeleteDiscNumber() error

func (*ID3v24) DeleteEncodedBy

func (id3v2 *ID3v24) DeleteEncodedBy() error

func (*ID3v24) DeleteGenre

func (id3v2 *ID3v24) DeleteGenre() error

func (*ID3v24) DeletePicture

func (id3v2 *ID3v24) DeletePicture() error

func (*ID3v24) DeleteTag

func (id3v2 *ID3v24) DeleteTag(name string) error

func (*ID3v24) DeleteTagTXXX

func (id3v2 *ID3v24) DeleteTagTXXX(name string) error

func (*ID3v24) DeleteTitle

func (id3v2 *ID3v24) DeleteTitle() error

func (*ID3v24) DeleteTrackNumber

func (id3v2 *ID3v24) DeleteTrackNumber() error

func (*ID3v24) DeleteYear

func (id3v2 *ID3v24) DeleteYear() error

func (*ID3v24) GetAlbum

func (id3v2 *ID3v24) GetAlbum() (string, error)

func (*ID3v24) GetAlbumArtist

func (id3v2 *ID3v24) GetAlbumArtist() (string, error)

func (*ID3v24) GetAllTagNames

func (id3v2 *ID3v24) GetAllTagNames() []string

func (*ID3v24) GetArranger

func (id3v2 *ID3v24) GetArranger() (string, error)

func (*ID3v24) GetArtist

func (id3v2 *ID3v24) GetArtist() (string, error)

func (*ID3v24) GetAttachedPicture

func (id3v2 *ID3v24) GetAttachedPicture() (*AttachedPicture, error)

func (*ID3v24) GetAuthor

func (id3v2 *ID3v24) GetAuthor() (string, error)

func (*ID3v24) GetBPM

func (id3v2 *ID3v24) GetBPM() (int, error)

func (*ID3v24) GetCatalogNumber

func (id3v2 *ID3v24) GetCatalogNumber() (string, error)

func (*ID3v24) GetComment

func (id3v2 *ID3v24) GetComment() (string, error)

func (*ID3v24) GetCompilation

func (id3v2 *ID3v24) GetCompilation() (string, error)

func (*ID3v24) GetComposer

func (id3v2 *ID3v24) GetComposer() (string, error)

func (*ID3v24) GetConductor

func (id3v2 *ID3v24) GetConductor() (string, error)

func (*ID3v24) GetCopyright

func (id3v2 *ID3v24) GetCopyright() (string, error)

func (*ID3v24) GetDate

func (id3v2 *ID3v24) GetDate() (time.Time, error)

func (*ID3v24) GetDescription

func (id3v2 *ID3v24) GetDescription() (string, error)

func (*ID3v24) GetDiscNumber

func (id3v2 *ID3v24) GetDiscNumber() (int, int, error)

func (*ID3v24) GetEncodedBy

func (id3v2 *ID3v24) GetEncodedBy() (string, error)

func (*ID3v24) GetFileData

func (id3v2 *ID3v24) GetFileData() []byte

func (*ID3v24) GetGenre

func (id3v2 *ID3v24) GetGenre() (string, error)

func (*ID3v24) GetInt

func (id3v2 *ID3v24) GetInt(name string) (int, error)

func (*ID3v24) GetIntTXXX

func (id3v2 *ID3v24) GetIntTXXX(name string) (int, error)

func (*ID3v24) GetPicture

func (id3v2 *ID3v24) GetPicture() (image.Image, error)

func (*ID3v24) GetString

func (id3v2 *ID3v24) GetString(name string) (string, error)

func (*ID3v24) GetStringTXXX

func (id3v2 *ID3v24) GetStringTXXX(name string) (string, error)

GetStringTXXX - get user frame Header for 'User defined text information frame' Text encoding $xx Description <text string according to encoding> $00 (00) Value <text string according to encoding>.

func (*ID3v24) GetTimestamp

func (id3v2 *ID3v24) GetTimestamp(name string) (time.Time, error)

func (*ID3v24) GetTitle

func (id3v2 *ID3v24) GetTitle() (string, error)

func (*ID3v24) GetTrackNumber

func (id3v2 *ID3v24) GetTrackNumber() (int, int, error)

func (*ID3v24) GetVersion

func (id3v2 *ID3v24) GetVersion() Version

func (*ID3v24) GetYear

func (id3v2 *ID3v24) GetYear() (int, error)

func (*ID3v24) Save

func (id3v2 *ID3v24) Save(input io.WriteSeeker) error

func (*ID3v24) SaveFile

func (id3v2 *ID3v24) SaveFile(path string) error

func (*ID3v24) SetAlbum

func (id3v2 *ID3v24) SetAlbum(album string) error

func (*ID3v24) SetAlbumArtist

func (id3v2 *ID3v24) SetAlbumArtist(albumArtist string) error

func (*ID3v24) SetArranger

func (id3v2 *ID3v24) SetArranger(arranger string) error

func (*ID3v24) SetArtist

func (id3v2 *ID3v24) SetArtist(artist string) error

func (*ID3v24) SetAttachedPicture

func (id3v2 *ID3v24) SetAttachedPicture(picture *AttachedPicture) error

nolint:gocritic

func (*ID3v24) SetAuthor

func (id3v2 *ID3v24) SetAuthor(author string) error

func (*ID3v24) SetBPM

func (id3v2 *ID3v24) SetBPM(bmp int) error

func (*ID3v24) SetCatalogNumber

func (id3v2 *ID3v24) SetCatalogNumber(catalogNumber string) error

func (*ID3v24) SetComment

func (id3v2 *ID3v24) SetComment(comment string) error

func (*ID3v24) SetCompilation

func (id3v2 *ID3v24) SetCompilation(compilation string) error

func (*ID3v24) SetComposer

func (id3v2 *ID3v24) SetComposer(composer string) error

func (*ID3v24) SetConductor

func (id3v2 *ID3v24) SetConductor(conductor string) error

func (*ID3v24) SetCopyright

func (id3v2 *ID3v24) SetCopyright(copyright string) error

func (*ID3v24) SetDate

func (id3v2 *ID3v24) SetDate(date time.Time) error

func (*ID3v24) SetDescription

func (id3v2 *ID3v24) SetDescription(description string) error

func (*ID3v24) SetDiscNumber

func (id3v2 *ID3v24) SetDiscNumber(number int, total int) error

func (*ID3v24) SetEncodedBy

func (id3v2 *ID3v24) SetEncodedBy(encodedBy string) error

func (*ID3v24) SetGenre

func (id3v2 *ID3v24) SetGenre(genre string) error

func (*ID3v24) SetInt

func (id3v2 *ID3v24) SetInt(name string, value int) error

func (*ID3v24) SetPicture

func (id3v2 *ID3v24) SetPicture(picture image.Image) error

func (*ID3v24) SetString

func (id3v2 *ID3v24) SetString(name string, value string) error

func (*ID3v24) SetStringTXXX

func (id3v2 *ID3v24) SetStringTXXX(name string, value string) error

func (*ID3v24) SetTimestamp

func (id3v2 *ID3v24) SetTimestamp(name string, value time.Time) error

func (*ID3v24) SetTitle

func (id3v2 *ID3v24) SetTitle(title string) error

func (*ID3v24) SetTrackNumber

func (id3v2 *ID3v24) SetTrackNumber(number int, total int) error

func (*ID3v24) SetYear

func (id3v2 *ID3v24) SetYear(year int) error

func (*ID3v24) String

func (id3v2 *ID3v24) String() string

type ID3v24Frame

type ID3v24Frame struct {
	Key   string
	Value []byte
}

type MP4

type MP4 struct {
	// contains filtered or unexported fields
}

func ReadMp4

func ReadMp4(input io.ReadSeeker) (*MP4, error)

func (*MP4) DeleteAlbum

func (mp4 *MP4) DeleteAlbum() error

func (*MP4) DeleteAlbumArtist

func (mp4 *MP4) DeleteAlbumArtist() error

func (*MP4) DeleteAll

func (mp4 *MP4) DeleteAll() error

func (*MP4) DeleteArranger

func (mp4 *MP4) DeleteArranger() error

func (*MP4) DeleteArtist

func (mp4 *MP4) DeleteArtist() error

func (*MP4) DeleteAuthor

func (mp4 *MP4) DeleteAuthor() error

func (*MP4) DeleteBPM

func (mp4 *MP4) DeleteBPM() error

func (*MP4) DeleteCatalogNumber

func (mp4 *MP4) DeleteCatalogNumber() error

func (*MP4) DeleteComment

func (mp4 *MP4) DeleteComment() error

func (*MP4) DeleteCompilation

func (mp4 *MP4) DeleteCompilation() error

func (*MP4) DeleteComposer

func (mp4 *MP4) DeleteComposer() error

func (*MP4) DeleteConductor

func (mp4 *MP4) DeleteConductor() error

func (*MP4) DeleteCopyright

func (mp4 *MP4) DeleteCopyright() error

func (*MP4) DeleteDate

func (mp4 *MP4) DeleteDate() error

func (*MP4) DeleteDescription

func (mp4 *MP4) DeleteDescription() error

func (*MP4) DeleteDiscNumber

func (mp4 *MP4) DeleteDiscNumber() error

func (*MP4) DeleteEncodedBy

func (mp4 *MP4) DeleteEncodedBy() error

func (*MP4) DeleteGenre

func (mp4 *MP4) DeleteGenre() error

func (*MP4) DeletePicture

func (mp4 *MP4) DeletePicture() error

func (*MP4) DeleteTitle

func (mp4 *MP4) DeleteTitle() error

func (*MP4) DeleteTrackNumber

func (mp4 *MP4) DeleteTrackNumber() error

func (*MP4) DeleteYear

func (mp4 *MP4) DeleteYear() error

func (*MP4) GetAlbum

func (mp4 *MP4) GetAlbum() (string, error)

func (*MP4) GetAlbumArtist

func (mp4 *MP4) GetAlbumArtist() (string, error)

func (*MP4) GetAllTagNames

func (mp4 *MP4) GetAllTagNames() []string

func (*MP4) GetArranger

func (mp4 *MP4) GetArranger() (string, error)

func (*MP4) GetArtist

func (mp4 *MP4) GetArtist() (string, error)

func (*MP4) GetAuthor

func (mp4 *MP4) GetAuthor() (string, error)

func (MP4) GetBPM

func (mp4 MP4) GetBPM() (int, error)

func (*MP4) GetCatalogNumber

func (mp4 *MP4) GetCatalogNumber() (string, error)

func (*MP4) GetComment

func (mp4 *MP4) GetComment() (string, error)

func (*MP4) GetCompilation

func (mp4 *MP4) GetCompilation() (string, error)

func (*MP4) GetComposer

func (mp4 *MP4) GetComposer() (string, error)

func (*MP4) GetConductor

func (mp4 *MP4) GetConductor() (string, error)

func (*MP4) GetCopyright

func (mp4 *MP4) GetCopyright() (string, error)

func (*MP4) GetDate

func (mp4 *MP4) GetDate() (time.Time, error)

func (*MP4) GetDescription

func (mp4 *MP4) GetDescription() (string, error)

func (*MP4) GetDiscNumber

func (mp4 *MP4) GetDiscNumber() (int, int, error)

func (*MP4) GetEncodedBy

func (mp4 *MP4) GetEncodedBy() (string, error)

func (*MP4) GetFileData

func (mp4 *MP4) GetFileData() []byte

func (*MP4) GetGenre

func (mp4 *MP4) GetGenre() (string, error)

func (*MP4) GetPicture

func (mp4 *MP4) GetPicture() (image.Image, error)

func (*MP4) GetTitle

func (mp4 *MP4) GetTitle() (string, error)

func (*MP4) GetTrackNumber

func (mp4 *MP4) GetTrackNumber() (int, int, error)

func (*MP4) GetVersion

func (mp4 *MP4) GetVersion() Version

func (*MP4) GetYear

func (mp4 *MP4) GetYear() (int, error)

func (*MP4) Save

func (mp4 *MP4) Save(output io.WriteSeeker) error

func (*MP4) SaveFile

func (mp4 *MP4) SaveFile(path string) error

func (*MP4) SetAlbum

func (mp4 *MP4) SetAlbum(album string) error

func (*MP4) SetAlbumArtist

func (mp4 *MP4) SetAlbumArtist(albumArtist string) error

func (*MP4) SetArranger

func (mp4 *MP4) SetArranger(arranger string) error

func (*MP4) SetArtist

func (mp4 *MP4) SetArtist(artist string) error

func (*MP4) SetAuthor

func (mp4 *MP4) SetAuthor(author string) error

func (*MP4) SetBPM

func (mp4 *MP4) SetBPM(bmp int) error

func (*MP4) SetCatalogNumber

func (mp4 *MP4) SetCatalogNumber(catalogNumber string) error

func (*MP4) SetComment

func (mp4 *MP4) SetComment(comment string) error

func (*MP4) SetCompilation

func (mp4 *MP4) SetCompilation(compilation string) error

func (*MP4) SetComposer

func (mp4 *MP4) SetComposer(composer string) error

func (*MP4) SetConductor

func (mp4 *MP4) SetConductor(conductor string) error

func (*MP4) SetCopyright

func (mp4 *MP4) SetCopyright(copyright string) error

func (*MP4) SetDate

func (mp4 *MP4) SetDate(date time.Time) error

func (*MP4) SetDescription

func (mp4 *MP4) SetDescription(description string) error

func (*MP4) SetDiscNumber

func (mp4 *MP4) SetDiscNumber(number int, total int) error

func (*MP4) SetEncodedBy

func (mp4 *MP4) SetEncodedBy(encodedBy string) error

func (*MP4) SetGenre

func (mp4 *MP4) SetGenre(genre string) error

func (*MP4) SetPicture

func (mp4 *MP4) SetPicture(picture image.Image) error

func (*MP4) SetTitle

func (mp4 *MP4) SetTitle(title string) error

func (*MP4) SetTrackNumber

func (mp4 *MP4) SetTrackNumber(number int, total int) error

func (*MP4) SetYear

func (mp4 *MP4) SetYear(year int) error

type MP4Atom

type MP4Atom struct {
	// contains filtered or unexported fields
}

type Metadata

type Metadata interface {
	GetMetadata
	SetMetadata
	DeleteMetadata
	SaveMetadata
}

func Read

func Read(input io.ReadSeeker) (Metadata, error)

func ReadFile

func ReadFile(path string) (Metadata, error)

type SaveMetadata

type SaveMetadata interface {
	SaveFile(path string) error
	Save(input io.WriteSeeker) error
}

type SetMetadata

type SetMetadata interface {
	SetTitle(title string) error
	SetArtist(artist string) error
	SetAlbum(album string) error
	SetYear(year int) error
	SetComment(comment string) error
	SetGenre(genre string) error
	SetAlbumArtist(albumArtist string) error
	SetDate(date time.Time) error
	SetArranger(arranger string) error
	SetAuthor(author string) error
	SetBPM(bmp int) error
	SetCatalogNumber(catalogNumber string) error
	SetCompilation(compilation string) error
	SetComposer(composer string) error
	SetConductor(conductor string) error
	SetCopyright(copyright string) error
	SetDescription(description string) error
	SetDiscNumber(number int, total int) error
	SetEncodedBy(encodedBy string) error
	SetTrackNumber(number int, total int) error
	SetPicture(picture image.Image) error
}

type Version

type Version int
const (
	// common consts.
	VersionUndefined Version = 0
	VersionID3v1     Version = 1
	VersionID3v22    Version = 2
	VersionID3v23    Version = 3
	VersionID3v24    Version = 4
	VersionMP4       Version = 5
	VersionFLAC      Version = 6

	// flac consts.
	FLACIdentifier = "fLaC" // flac format identifier

)

func CheckVersion

func CheckVersion(input io.ReadSeeker) Version

func (Version) String

func (v Version) String() string

type VorbisComment

type VorbisComment struct {
	Name  string
	Value string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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