id3

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

go-id3

Go lib and binary for working with id3v1, id3v2, id3v2.3, and id3v2.4 tags.

GoDoc Circle CI Go Report Card codecov Maintainability Test Coverage

explanation

Whilst putting together a simple single-streaming music application, there was a need to have a simple and comprehensive tag processor. To be more cross-platform and readily available, this side-project was born to suit the purpose. A library is provided for other project usage, along with binary for specific command-line usage when required.

requirements

  • go

installation

Standard installation is using go get github.com/cloudcloud/go-id3/... to import the libraries and compile the binaries. Your go environment will need to be correctly configured and available for this to function correctly though.

Documentation

Overview

Package id3 provides the interfacing methods to working with a file on the filesystem and pushing content into necessary processors for tag discovery and usage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Filename string `json:"filename"`
	V1       *V1    `json:"id3v1"`
	V2       *V2    `json:"id3v2"`
	Debug    bool   `json:"-"`
	// contains filtered or unexported fields
}

File provides the data container for an individual File

func (*File) GetAlbum

func (f *File) GetAlbum() string

GetAlbum will determine the ideal Album string for use.

func (*File) GetArtist

func (f *File) GetArtist() string

GetArtist will determine the ideal Artist string for use.

func (*File) GetTitle

func (f *File) GetTitle() string

GetTitle will provide the title found for the song.

func (*File) PrettyPrint

func (f *File) PrettyPrint(o io.Writer, format string)

PrettyPrint draws a nice representation of the file for the command line

func (*File) Process

func (f *File) Process(h frames.FrameFile) *File

Process will begin the opening and loading of File content

type V1

type V1 struct {
	Artist  string `json:"artist"`
	Title   string `json:"title"`
	Album   string `json:"album"`
	Year    int    `json:"year"`
	Comment string `json:"comment"`
	Track   int    `json:"track"`
	Genre   int    `json:"genre"`

	Debug bool `json:"-"`
}

V1 is a structure for Version 1 ID3 content

func (*V1) Parse

func (i *V1) Parse(h frames.FrameFile) error

Parse completes the actual processing of the file and extracts the tag information.

type V2

type V2 struct {
	Frames         []frames.IFrame `json:"frames"`
	Major          int             `json:"major_version"`
	Min            int             `json:"min_version"`
	Flag           byte            `json:"flag"`
	Size           int             `json:"tag_size"`
	Unsynchronised bool            `json:"unsynchronised"`
	Extended       bool            `json:"extended"`
	Experimental   bool            `json:"experimental"`
	Footer         bool            `json:"footer"`

	ExtendedSize    int    `json:"extended_size" yaml:"extended_size"`
	ExtendedFlag    []byte `json:"extended_flag" yaml:"extended_flag"`
	ExtendedPadding int    `json:"extended_padding" yaml:"extended_padding"`
	Crc             bool   `json:"crc"`
	CrcContent      []byte `json:"crc_content" yaml:"crc_content"`

	Debug bool `json:"-"`
	// contains filtered or unexported fields
}

V2 is a structure for housing all ID3 V2 information Frames are listed individually, but overall meta is local

func (*V2) GetAlbum

func (f *V2) GetAlbum() string

GetAlbum will determine and give the ideal album

func (*V2) GetArtist

func (f *V2) GetArtist() string

GetArtist will retrieve the ideal artist for use

func (*V2) GetFrame

func (f *V2) GetFrame(n string) frames.IFrame

GetFrame will provide a specific Frame if it exists

func (*V2) GetTitle

func (f *V2) GetTitle() string

GetTitle will determine the ideal title for the song.

func (*V2) Parse

func (f *V2) Parse(h frames.FrameFile) error

Parse will trawl a file handle for frames

type Version

type Version interface {
	Parse(frames.FrameFile) error
}

Version is an interface for individual version implementations

Directories

Path Synopsis
cmd
go-id3
Package main provides a library for working with ID3 tags in Audio and Video files.
Package main provides a library for working with ID3 tags in Audio and Video files.
Package frames will provide abstractions for processing indivudal frames within tags
Package frames will provide abstractions for processing indivudal frames within tags

Jump to

Keyboard shortcuts

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