id3

package module
v0.0.0-...-73f4b1c Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2013 License: Apache-2.0 Imports: 7 Imported by: 5

README

ID3 Parsing For Go

Andrew Scherkus May 21, 2012

Introduction

Simple ID3 parsing library for go based on the specs at www.id3.org.

It doesn't handle everything but at least gets the imporant bits like artist, album, track, etc...

Usage

Pass in a suitable io.Reader and away you go!

fd, _ := os.Open("foo.mp3")
defer fd.Close()
file := id3.Read(fd)
if file != nil {
        fmt.Println(file)
}

Examples

An example tag reading program can be found under id3/tagreader.

go install github.com/dustin/id3/tagreader
$GOPATH/bin/tagreader path/to/file.mp3 [...]

Documentation

Overview

Package id3 implements basic ID3 parsing for MP3 files.

Instead of providing access to every single ID3 frame this package exposes only the ID3v2 header and a few basic fields such as the artist, album, year, etc...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ISO8859_1ToUTF8

func ISO8859_1ToUTF8(data []byte) string

Types

type File

type File struct {
	Header ID3v2Header

	Name   string
	Artist string
	Album  string
	Year   string
	Track  string
	Disc   string
	Genre  string
	Length string
}

A parsed ID3 file with common fields exposed.

func Read

func Read(reader io.Reader) (file *File)

Parse the input for ID3 information. Returns nil if parsing failed or the input didn't contain ID3 information.

type ID3v2Header

type ID3v2Header struct {
	Version           int
	MinorVersion      int
	Unsynchronization bool
	Extended          bool
	Experimental      bool
	Footer            bool
	Size              int32
}

A parsed ID3v2 header as defined in Section 3 of http://id3.org/id3v2.4.0-structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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