All Projects β†’ bogem β†’ Id3v2

bogem / Id3v2

Licence: mit
🎡 ID3 decoding and encoding library for Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Id3v2

Awesome Piracy
A curated list of awesome warez and piracy links
Stars: ✭ 13,911 (+7628.33%)
Mutual labels:  music
Otter
Music player for Funkwhale
Stars: ✭ 177 (-1.67%)
Mutual labels:  music
Cmus Osx
Adds track change notifications, and media key support to cmus.
Stars: ✭ 179 (-0.56%)
Mutual labels:  music
Spotify Now Playing
Spotify now playing information and control popup for macOS menu bar
Stars: ✭ 171 (-5%)
Mutual labels:  music
Live Stream Radio
24/7 live stream video radio station CLI / API πŸ“Ή πŸ“»
Stars: ✭ 175 (-2.78%)
Mutual labels:  music
Muda
A library for augmenting annotated audio data
Stars: ✭ 177 (-1.67%)
Mutual labels:  music
Mirdata
Python library to work with Music Information Retrieval datasets
Stars: ✭ 170 (-5.56%)
Mutual labels:  music
Mixxx
Mixxx is Free DJ software that gives you everything you need to perform live mixes.
Stars: ✭ 2,510 (+1294.44%)
Mutual labels:  music
Awesome Deep Learning Music
List of articles related to deep learning applied to music
Stars: ✭ 2,195 (+1119.44%)
Mutual labels:  music
Musicx Music Player
Simple, Elegant ,Beautiful Material Android Music Player.
Stars: ✭ 179 (-0.56%)
Mutual labels:  music
Tonejs Instruments
A small instrument sample library with quick-loader for tone.js
Stars: ✭ 172 (-4.44%)
Mutual labels:  music
Piano fundamentals
This is a Sphinx adaptation of Chaun C. Chang's book, "Fundamentals of Piano Practice."
Stars: ✭ 174 (-3.33%)
Mutual labels:  music
Sdmusic
Search && Download Music from multi-platform
Stars: ✭ 178 (-1.11%)
Mutual labels:  music
Libatm
Library for generating and working with MIDI files
Stars: ✭ 171 (-5%)
Mutual labels:  music
Zen Audio Player.github.io
Listen to YouTube videos, without the distracting visuals.
Stars: ✭ 180 (+0%)
Mutual labels:  music
Muzonchik
iOS Music App that let you search, download and play music
Stars: ✭ 170 (-5.56%)
Mutual labels:  music
Ncmdump
netease cloud music copyright protection file dump
Stars: ✭ 2,058 (+1043.33%)
Mutual labels:  music
Sopullupview
SOPullUpView library for iOS, with pull up gesture πŸ“±πŸ–οΈβ†•οΈ
Stars: ✭ 182 (+1.11%)
Mutual labels:  music
Piano Rs
A multiplayer piano using UDP sockets that can be played using computer keyboard, in the terminal
Stars: ✭ 180 (+0%)
Mutual labels:  music
Aubio
a library for audio and music analysis
Stars: ✭ 2,601 (+1345%)
Mutual labels:  music

id3v2

Supported ID3 versions: 2.3, 2.4

Installation

go get -u github.com/bogem/id3v2

Usage example

package main

import (
	"fmt"
	"log"

	"github.com/bogem/id3v2"
)

func main() {
	tag, err := id3v2.Open("file.mp3", id3v2.Options{Parse: true})
	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("Aphex Twin")
	tag.SetTitle("Xtal")

	comment := id3v2.CommentFrame{
		Encoding:    id3v2.EncodingUTF8,
		Language:    "eng",
		Description: "My opinion",
		Text:        "I like this song!",
	}
	tag.AddCommentFrame(comment)

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

Read multiple frames

pictures := tag.GetFrames(tag.CommonID("Attached picture"))
for _, f := range pictures {
	pic, ok := f.(id3v2.PictureFrame)
	if !ok {
		log.Fatal("Couldn't assert picture frame")
	}

	// Do something with picture frame.
	fmt.Println(pic.Description)
}

Encodings

For example, if you want to set comment frame with custom encoding, you may do the following:

comment := id3v2.CommentFrame{
	Encoding:    id3v2.EncodingUTF16,
	Language:    "ger",
	Description: "Tier",
	Text:        "Der LΓΆwe",
}
tag.AddCommentFrame(comment)

Text field will be automatically encoded with UTF-16BE with BOM and written to w.

UTF-8 is default for v2.4, ISO-8859-1 - for v2.3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].