mp3mp4tag

package module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

README

mp3-mp4-tag

ID3 and MP4 tag reader and writer for go

Go Reference

This module allows you to parse and write ID tags for mp3 and mp4 (m4a, m4b, m4p) files.

Simply use the OpenTag() function with a string file path as the argument and the library will return the IDTag.

You can access all of the fields of the IDTag through the accessor functions.

Fields that can be parsed:

MP3: Artist, AlbumArtist, Album, AlbumArt, Comments, Composer, Genre, Title, Year, BPM, ContentType, CopyrightMessage, Date, EncodedBy, Lyricist, FileType, Language, Length, PartOfSet, and Publisher

MP4: Artist, AlbumArtist, Album, AlbumArt, Comments, Composer, Genre, Title, Year, EncodedBy, and CopyrightMessage

Fields that can be written:

MP3: Artist, AlbumArtist, Album, AlbumArt, Comments, Composer, Genre, Title, Year, BPM, ContentType, CopyrightMessage, Date, EncodedBy, Lyricist, FileType, Language, Length, PartOfSet, and Publisher

MP4: Artist, AlbumArtist, Album, AlbumArt, Comments, Composer, Genre, Title, Year, and CopyrightMessage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAtoms

func ReadAtoms(r io.ReadSeeker) (metadataMP4, error)

ReadAtoms reads MP4 metadata atoms from the io.ReadSeeker into a Metadata, returning non-nil error if there was a problem.

func ReadFromMP4

func ReadFromMP4(r io.ReadSeeker) (metadataMP4, error)

func SaveTag

func SaveTag(tag *IDTag) error

This operation saves the corresponding IDTag to the mp3/mp4 file that it references and returns an error if the saving process fails

Types

type ID3Frames

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

type IDTag

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

func OpenTag

func OpenTag(filepath string) (*IDTag, error)

Opens the ID tag for the corresponding file as long as it is a supported filetype Use the OpenTag command and you will be able to access all metadata associated with the file

func (*IDTag) Album

func (tag *IDTag) Album() string

func (*IDTag) AlbumArt

func (tag *IDTag) AlbumArt() *image.Image

func (*IDTag) AlbumArtist

func (tag *IDTag) AlbumArtist() string

func (*IDTag) Artist

func (tag *IDTag) Artist() string

func (*IDTag) BPM

func (tag *IDTag) BPM() string

func (*IDTag) ClearAllTags

func (tag *IDTag) ClearAllTags()

clears all tags except the fileUrl tag which is used to reference the file

func (*IDTag) Comments

func (tag *IDTag) Comments() string

func (*IDTag) Composer

func (tag *IDTag) Composer() string

func (*IDTag) ContentType

func (tag *IDTag) ContentType() string

func (*IDTag) CopyrightMsg

func (tag *IDTag) CopyrightMsg() string

func (*IDTag) Date

func (tag *IDTag) Date() string

func (*IDTag) EncodedBy

func (tag *IDTag) EncodedBy() string

func (*IDTag) FileType

func (tag *IDTag) FileType() string

func (*IDTag) Genre

func (tag *IDTag) Genre() string

func (*IDTag) Language

func (tag *IDTag) Language() string

func (*IDTag) Length

func (tag *IDTag) Length() string

func (*IDTag) Lyricist

func (tag *IDTag) Lyricist() string

func (*IDTag) PartOfSet

func (tag *IDTag) PartOfSet() string

func (*IDTag) Publisher

func (tag *IDTag) Publisher() string

func (*IDTag) Save

func (tag *IDTag) Save() error

This operation saves the corresponding IDTag to the mp3/mp4 file that it references and returns an error if the saving process fails

func (*IDTag) SetAlbum

func (tag *IDTag) SetAlbum(album string)

func (*IDTag) SetAlbumArtFromByteArray

func (tag *IDTag) SetAlbumArtFromByteArray(albumArt []byte) error

func (*IDTag) SetAlbumArtFromFilePath

func (tag *IDTag) SetAlbumArtFromFilePath(filePath string) error

func (*IDTag) SetAlbumArtFromImage

func (tag *IDTag) SetAlbumArtFromImage(albumArt *image.Image)

func (*IDTag) SetAlbumArtist

func (tag *IDTag) SetAlbumArtist(albumArtist string)

func (*IDTag) SetArtist

func (tag *IDTag) SetArtist(artist string)

func (*IDTag) SetBPM

func (tag *IDTag) SetBPM(bpm string)

func (*IDTag) SetComments

func (tag *IDTag) SetComments(comments string)

func (*IDTag) SetComposer

func (tag *IDTag) SetComposer(composer string)

func (*IDTag) SetContentType

func (tag *IDTag) SetContentType(contentType string)

func (*IDTag) SetCopyrightMsg

func (tag *IDTag) SetCopyrightMsg(copyrightMsg string)

func (*IDTag) SetDate

func (tag *IDTag) SetDate(date string)

func (*IDTag) SetEncodedBy

func (tag *IDTag) SetEncodedBy(encodedBy string)

func (*IDTag) SetFileType

func (tag *IDTag) SetFileType(fileType string)

func (*IDTag) SetGenre

func (tag *IDTag) SetGenre(genre string)

func (*IDTag) SetLanguage

func (tag *IDTag) SetLanguage(language string)

func (*IDTag) SetLength

func (tag *IDTag) SetLength(length string)

func (*IDTag) SetLyricist

func (tag *IDTag) SetLyricist(lyricist string)

func (*IDTag) SetPartOfSet

func (tag *IDTag) SetPartOfSet(partOfSet string)

func (*IDTag) SetPublisher

func (tag *IDTag) SetPublisher(publisher string)

func (*IDTag) SetTitle

func (tag *IDTag) SetTitle(title string)

func (*IDTag) SetYear

func (tag *IDTag) SetYear(year string)

func (*IDTag) Title

func (tag *IDTag) Title() string

func (*IDTag) Year

func (tag *IDTag) Year() string

type Picture

type Picture struct {
	Ext         string // Extension of the picture file.
	MIMEType    string // MIMEType of the picture.
	Type        string // Type of the picture (see pictureTypes).
	Description string // Description.
	Data        []byte // Raw picture data.
}

Jump to

Keyboard shortcuts

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