Documentation ¶
Overview ¶
Package audiometa is an all in one solution for reading and writing audio meta data in Go. It's the only Go module available that can read and write OGG Vorbis and OGG Opus metadata. auidometa supports several different filetypes and a wide range of tags.
Index ¶
- Constants
- func GetFileType(filepath string) (string, error)
- func SaveTag(tag *IDTag) error
- type IDTag
- func (tag *IDTag) AdditionalTags() map[string]string
- func (tag *IDTag) Album() string
- func (tag *IDTag) AlbumArtist() string
- func (tag *IDTag) Artist() string
- func (tag *IDTag) BPM() string
- func (tag *IDTag) ClearAllTags(preserveUnknown ...bool)
- func (tag *IDTag) Comments() string
- func (tag *IDTag) Composer() string
- func (tag *IDTag) CopyrightMsg() string
- func (tag *IDTag) Date() string
- func (tag *IDTag) EncodedBy() string
- func (tag *IDTag) FileType() string
- func (tag *IDTag) Genre() string
- func (tag *IDTag) Language() string
- func (tag *IDTag) Length() string
- func (tag *IDTag) Lyricist() string
- func (tag *IDTag) PartOfSet() string
- func (tag *IDTag) Publisher() string
- func (tag *IDTag) Save() error
- func (tag *IDTag) SetAdditionalTag(id string, value string)
- func (tag *IDTag) SetAlbum(album string)
- func (tag *IDTag) SetAlbumArtFromByteArray(albumArt []byte) error
- func (tag *IDTag) SetAlbumArtFromFilePath(filePath string) error
- func (tag *IDTag) SetAlbumArtFromImage(albumArt *image.Image)
- func (tag *IDTag) SetAlbumArtist(albumArtist string)
- func (tag *IDTag) SetArtist(artist string)
- func (tag *IDTag) SetBPM(bpm string)
- func (tag *IDTag) SetComments(comments string)
- func (tag *IDTag) SetComposer(composer string)
- func (tag *IDTag) SetCopyrightMsg(copyrightMsg string)
- func (tag *IDTag) SetDate(date string)
- func (tag *IDTag) SetEncodedBy(encodedBy string)
- func (tag *IDTag) SetFileType(fileType string)
- func (tag *IDTag) SetGenre(genre string)
- func (tag *IDTag) SetLanguage(language string)
- func (tag *IDTag) SetLength(length string)
- func (tag *IDTag) SetLyricist(lyricist string)
- func (tag *IDTag) SetPartOfSet(partOfSet string)
- func (tag *IDTag) SetPublisher(publisher string)
- func (tag *IDTag) SetTitle(title string)
- func (tag *IDTag) SetYear(year string)
- func (tag *IDTag) Title() string
- func (tag *IDTag) Year() string
- type MP4Delete
Constants ¶
const ( // Continuation of packet COP byte = 1 << iota // Beginning of stream BOS = 1 << iota // End of stream EOS = 1 << iota )
const ( MP3 string = "mp3" M4P string = "m4p" M4A string = "m4a" M4B string = "m4b" MP4 string = "mp4" FLAC string = "flac" OGG string = "ogg" )
const ( ALBUM string = "album" ARTIST string = "artist" DATE string = "date" TITLE string = "title" GENRE string = "genre" )
const MIMEType = "application/ogg"
The MIME type as defined in RFC 3534.
Variables ¶
This section is empty.
Functions ¶
func GetFileType ¶
GetFileType returns the file type of the file pointed to by filepath. If the filetype is not supported, an error is returned.
Types ¶
type IDTag ¶
The IDTag represents all of the metadata that can be retrieved from a file. The IDTag contains all tags for all audio types. Some tags may not be applicable to all types. Only the valid types are written to the respective data files. Although a tag may be set, if the function to write that tag attribute doesn't exist, the tag attribute will be ignored and the save function will not produce an error.
func OpenTag ¶
OpenTag 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) AdditionalTags ¶
AdditionalTags gets all additional (unmapped) tags
func (*IDTag) AlbumArtist ¶
AlbumArtist gets the album artist for a tag
func (*IDTag) ClearAllTags ¶
ClearAllTags clears all tags except the fileUrl tag which is used to reference the file, takes an optional parameter "preserveUnkown": when this is true passThroughMap is not cleared and unknown tags are preserved
func (*IDTag) CopyrightMsg ¶
CopyrightMs gets the Copyright Messgae for a tag
func (*IDTag) Save ¶
Save saves the corresponding IDTag to the audio file that it references and returns an error if the saving process fails
func (*IDTag) SetAdditionalTag ¶
SetAdditionalTag sets an additional (unmapped) tag taking an id and value (id,value) (ogg only)
func (*IDTag) SetAlbumArtFromByteArray ¶
SetAlbumArtFromByteArray sets the album art by passing a byte array for the album art
func (*IDTag) SetAlbumArtFromFilePath ¶
SetAlbumArtFromFilePath sets the album art by passing a filepath as a string
func (*IDTag) SetAlbumArtFromImage ¶
SetAlbumArtFromImage sets the album art by passing an *image.Image as the album art
func (*IDTag) SetAlbumArtist ¶
SetAlbumArtist sets the album artist for a tag
func (*IDTag) SetComments ¶
SetComments sets the comments for a tag
func (*IDTag) SetComposer ¶
SetComposer sets the composer for a tag
func (*IDTag) SetCopyrightMsg ¶
SetCopyrightMsg sets the Copyright Message for a tag
func (*IDTag) SetEncodedBy ¶
SetEncodedBy sets who encoded the tag
func (*IDTag) SetFileType ¶
SetFileType sets the filtype of the tag
func (*IDTag) SetLanguage ¶
SetLanguage sets the lanuguage of the tag
func (*IDTag) SetLyricist ¶
SetLyricist sets the lyricist for the tag
func (*IDTag) SetPartOfSet ¶
SetPartOfSet sets if the track is part of a set
func (*IDTag) SetPublisher ¶
SetPublisher sets the publisher for the tag