Fast and stable ID3 parsing and writing library for Go
Go
Permalink
Failed to load latest commit information.
bwpool Add bwpool Dec 6, 2016
rdpool Simplify rdpool Dec 6, 2016
testdata Make saving temp file in the same directory as source file in tag.Save Jan 18, 2017
util Change bytes.Reader.Reset to bytes.NewReader Oct 24, 2016
.travis.yml Update .travis.yml Oct 22, 2016
LICENSE First commit! May 15, 2016
README.md Update README.md Jan 16, 2017
bench_test.go Add WriteTo and Size methods to Framer Dec 5, 2016
comment_frame.go Fix signature of framer.WriteTo Dec 6, 2016
comment_sequence.go Rename Len method to Count Oct 28, 2016
common_ids.go Rename ID methods and vars to CommonID Oct 1, 2016
framer.go Edit comment of Framer.Body() Dec 8, 2016
header.go Make util.Parse/FormSize to return errors Oct 11, 2016
header_test.go Add support of ID3v2.3 Sep 1, 2016
id3v2.go Update id3v2.go Jan 16, 2017
parse.go Use first lower-case letter in errors Oct 30, 2016
parse_test.go Add WriteTo and Size methods to Framer Dec 5, 2016
picture_frame.go Fix indentation of picture frame comment Dec 8, 2016
picture_sequence.go Rename Len method to Count Oct 28, 2016
sequencer.go Rename Len method to Count Oct 28, 2016
tag.go Make saving temp file in the same directory as source file in tag.Save Jan 18, 2017
tag_test.go Add WriteTo and Size methods to Framer Dec 5, 2016
text_frame.go Fix signature of framer.WriteTo Dec 6, 2016
unknown_frame.go Fix signature of framer.WriteTo Dec 6, 2016
unsynchronised_lyrics_frame.go Fix signature of framer.WriteTo Dec 6, 2016
uslf_sequence.go Rename Len method to Count Oct 28, 2016

README.md

GoDoc Build Status Go Report Card

id3v2

IMHO

I think, ID3 is a very overwhelmed standard: it does more than it really should do. There are a lot of aspects, which developer should take into consideration. And that's why it's pretty complicated to write a good library. So if you have some thoughts and ideas or if you want to support me about writing a new simple and elegant standard for providing information for digital music tracks, just write me an e-mail. I think, it's a good time to write an appropriate standard for it 😉

Description

Fast and stable ID3 parsing and writing library for Go

It can:

  • Support ID3v2.3 and ID3v2.4 tags
  • Parse and write tags
  • Set artist, album, year, genre, unsynchronised lyrics/text (USLT), comments and attached pictures
  • Set several USLTs, comments and attached pictures
  • Work with all available encodings

It can't:

  • Do unsyncronization
  • Work with extended header, flags, padding, footer

id3v2 is still in beta. Until version 1.0 the API may be changed.

If you want some functionality, that library can't do, or you have some questions, just write an issue.

And of course, pull requests are welcome!

Installation

$ go get -u github.com/bogem/id3v2

Example of Usage:

package main

import (
    "fmt"
    "log"

    "github.com/bogem/id3v2"
)

func main() {
    // Open file and find tag in it
    tag, err := id3v2.Open("file.mp3")
    if err != nil {
        log.Fatal("Error while opening mp3 file: ", err)
    }
    defer tag.Close()

    // Read tags
    fmt.Println(tag.Artist())
    fmt.Println(tag.Title())

    // Set tags
    tag.SetArtist("New artist")
    tag.SetTitle("New title")

    comment := id3v2.CommentFrame{
        Encoding:    id3v2.ENUTF8,
        Language:    "eng",
        Description: "My opinion",
        Text:        "Very good song",
    }
    tag.AddCommentFrame(comment)

    // Write it to file
    if err = tag.Save(); err != nil {
        log.Fatal("Error while saving a tag: ", err)
    }
}

Documentation

You can find it here: https://godoc.org/github.com/bogem/id3v2

TODO

  • Unsynchronization (?)
  • Work with extended header, flags, padding, footer (Does anyone really use it?)
  • ID3v2.3 Support
  • Parse tags
  • Documentation
  • Work with other encodings

License

MIT