tags

package
v0.0.0-...-a962232 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagUnsynchronisation = 0b10000000
	FlagExtendedHeader    = 0b01000000
	FlagExperimental      = 0b00100000
)
View Source
const (
	MinimalPaddingSize = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	FileIdentifier    []byte
	MajorVersion      byte
	Revision          byte
	Unsynchronisation bool
	ExtendedHeader    bool
	Experimental      bool
	// If the tag changes in anyway, this may be out dated and should be updated upon writing.
	Size int
}

func NewHeader

func NewHeader(data []byte) Header

func (*Header) Equal

func (h *Header) Equal(h2 *Header) bool

func (*Header) MarshalBinary

func (h *Header) MarshalBinary() ([]byte, error)

func (Header) String

func (i Header) String() string

func (*Header) UnmarshalBinary

func (h *Header) UnmarshalBinary(data []byte) error

type ID3v2

type ID3v2 struct {
	Header *Header
	Frames *frames.Frames
}

func NewID3v2

func NewID3v2() *ID3v2

func NewID3v2FromFile

func NewID3v2FromFile(file string) (*ID3v2, error)

NewID3v2FromFile reads in and unmarshals the entire ID3v2.3 tag.

func (*ID3v2) ApplyFrames

func (i *ID3v2) ApplyFrames(fs map[string]frames.FrameBody) error

func (*ID3v2) MarshalBinary

func (i *ID3v2) MarshalBinary() ([]byte, error)

MarshalBinaryv2 will only marshal the id3v2 tag to binary.

func (*ID3v2) String

func (i *ID3v2) String() string

func (*ID3v2) UnmarshalBinary

func (i *ID3v2) UnmarshalBinary(b []byte) error

func (*ID3v2) Write

func (t *ID3v2) Write(src, dst string) error

Write writes the tag to the dst file, using the src file as the original. In cases where the src and dst are the same, there is an optimization that can happen: just rewrite the header.

type NoID3v2IdentifierError

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

func NewNoID3v2IdentifierError

func NewNoID3v2IdentifierError(actual []byte) *NoID3v2IdentifierError

func (*NoID3v2IdentifierError) Error

func (n *NoID3v2IdentifierError) Error() string

Jump to

Keyboard shortcuts

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