metaflac

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STREAMINFO     = 0
	PADDING        = 1
	APPLICATION    = 2
	SEEKTABLE      = 3
	VORBIS_COMMENT = 4
	CUESHEET       = 5
	PICTURE        = 6
)

Metadata block types

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	BlockType int
	Data      []byte
}

Block represents a FLAC metadata block.

type Metaflac

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

Metaflac handles FLAC metadata manipulation.

func NewMetaflac

func NewMetaflac(flac []byte) (*Metaflac, error)

NewMetaflac initializes a new Metaflac instance.

func (*Metaflac) GetAllTags

func (m *Metaflac) GetAllTags() []string

GetAllTags returns all tags.

func (*Metaflac) GetBps

func (m *Metaflac) GetBps() uint8

GetBps returns the bits per sample from the STREAMINFO block.

func (*Metaflac) GetBuffer

func (m *Metaflac) GetBuffer() []byte

GetBuffer returns the modified FLAC buffer.

func (*Metaflac) GetChannels

func (m *Metaflac) GetChannels() uint8

GetChannels returns the number of channels from the STREAMINFO block.

func (*Metaflac) GetMaxBlocksize

func (m *Metaflac) GetMaxBlocksize() uint16

GetMaxBlocksize returns the maximum block size from the STREAMINFO block.

func (*Metaflac) GetMaxFramesize

func (m *Metaflac) GetMaxFramesize() uint32

GetMaxFramesize returns the maximum frame size from the STREAMINFO block.

func (*Metaflac) GetMd5sum

func (m *Metaflac) GetMd5sum() string

GetMd5sum returns the MD5 signature from the STREAMINFO block.

func (*Metaflac) GetMinBlocksize

func (m *Metaflac) GetMinBlocksize() uint16

GetMinBlocksize returns the minimum block size from the STREAMINFO block.

func (*Metaflac) GetMinFramesize

func (m *Metaflac) GetMinFramesize() uint32

GetMinFramesize returns the minimum frame size from the STREAMINFO block.

func (*Metaflac) GetPicturesSpecs

func (m *Metaflac) GetPicturesSpecs() []PictureSpec

GetPicturesSpecs returns the specifications of all imported pictures.

func (*Metaflac) GetSampleRate

func (m *Metaflac) GetSampleRate() uint32

GetSampleRate returns the sample rate from the STREAMINFO block.

func (*Metaflac) GetTag

func (m *Metaflac) GetTag(name string) []string

GetTag retrieves all tags matching the given name.

func (*Metaflac) GetTotalSamples

func (m *Metaflac) GetTotalSamples() uint64

GetTotalSamples returns the total number of samples from the STREAMINFO block.

func (*Metaflac) GetVendorTag

func (m *Metaflac) GetVendorTag() string

GetVendorTag returns the vendor string from the VORBIS_COMMENT block.

func (*Metaflac) ImportPicture

func (m *Metaflac) ImportPicture(pictureData []byte, spec PictureSpec)

ImportPicture imports a picture into a PICTURE metadata block.

func (*Metaflac) RemoveAllTags

func (m *Metaflac) RemoveAllTags()

RemoveAllTags removes all tags, leaving only the vendor string.

func (*Metaflac) RemoveFirstTag

func (m *Metaflac) RemoveFirstTag(name string)

RemoveFirstTag removes the first tag with the given name.

func (*Metaflac) RemoveTag

func (m *Metaflac) RemoveTag(name string)

RemoveTag removes all tags with the given name.

func (*Metaflac) SetTag

func (m *Metaflac) SetTag(field string) error

SetTag adds a new tag.

type PictureSpec

type PictureSpec struct {
	Type        uint32
	Mime        string
	Description string
	Width       uint32
	Height      uint32
	Depth       uint32
	Colors      uint32
}

PictureSpec holds the specifications of a picture block.

Jump to

Keyboard shortcuts

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