tags

package module
v0.0.0-...-4d741c0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 6 Imported by: 1

README

tags

Use taglib in Go

Usage

Windows
  • install gcc (tdm or msys or ...)
  • run source source.bash (for windows)
  • use go get github.com/raffleberry/tags
  • run your app

Building libs/binaries

Windows(Msys2)
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-taglib
Linux
# ubuntu
git clone https://github.com/taglib/taglib
sudo apt install gcc g++ cmake make libutfcpp-dev zlib1g-dev

# (Static builds)
./bake taglib

test the cli program build/tags to double check if it worked.

go get github.com/raffleberry/tags

Debugging

./bake clean

clean before rebuilds

Docs

https://pkg.go.dev/github.com/raffleberry/tags

Documentation

Index

Constants

View Source
const (
	ENCODING_LATIN_1 = C.int(0)
	ENCODING_UTF_8   = C.int(1)
)

Variables

View Source
var (
	ErrInvalidFile    = errors.New("invalid file")
	ErrNoPictureFound = errors.New("no embedded picture found")
)

Functions

This section is empty.

Types

type Info

type Info struct {

	// Tag api.
	Tag struct {
		Title   string
		Artist  string
		Album   string
		Comment string
		Genre   string
		// 0 if the year is not set.
		Year int
		// 0 if the track number is not set.
		Track int
	}

	// Audio Properties api.
	Audio struct {
		// length of the file in seconds.
		Length int
		// bitrate of the file in kb/s.
		Bitrate int
		// sample rate of the file in Hz.
		Samplerate int
		// the number of channels in the audio stream.
		Channels int
	}

	// Properties api.
	Props map[string][]string
	// contains filtered or unexported fields
}

func Read

func Read(fp string) (*Info, error)

fp - path to the file to be read

func (*Info) Close

func (t *Info) Close()

func (*Info) GetPicture

func (t *Info) GetPicture() ([]byte, error)

Directories

Path Synopsis
cmd
cli command

Jump to

Keyboard shortcuts

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