Giter Site home page Giter Site logo

audiotags's Introduction

audiotags

library and command to retrieve audio metadata tags (uses TagLib)

  • uses libtag directly (doesn't use the C bindings)
  • read and write support
  • returns the extended metadata (albumartist, composer, discnumber, etc...)
  • builds with cgo

Install command and library

go get github.com/nbonaparte/audiotags/audiotags

Install library

go get github.com/nbonaparte/audiotags

Command example

# audiotags '/store/music/John Holloway/J.S. Bach_ The Sonatas and Partitas for violin solo/2-09 Allegro assai [Sonata No. 3 in C major BWV 1005].mp3'
album J.S. Bach: The Sonatas and Partitas for violin solo
date 2007
filetype MPG/3
title Allegro assai [Sonata No. 3 in C major BWV 1005]
tracknumber 9
albumartist John Holloway
artist John Holloway
composer Johann Sebastian Bach
discnumber 2/2
genre Classical
length 320
bitrate 222
samplerate 44100
channels 2

Library example

package main

import (
	"fmt"
	"github.com/nbonaparte/audiotags"
	"log"
	"os"
)

func main() {

	if len(os.Args) != 2 {
		fmt.Println("pass path to file")
		return
	}

	props, audioProps, err := audiotags.Read(os.Args[1])

	if err != nil {
		log.Fatal(err)
	}

	for k, v := range props {
		fmt.Printf("%s %s\n", k, v)
	}

	fmt.Printf("length %d\nbitrate %d\nsamplerate %d\nchannels %d\n",
		audioProps.Length, audioProps.Bitrate, audioProps.Samplerate, audioProps.Channels)

}

Dependencies

On Debian/Ubuntu:

apt-get install libtag1-vanilla

On OS X:

brew install taglib

audiotags's People

Contributors

nbonaparte avatar nicksellen avatar 02strich avatar sentriz avatar ehoward1996 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.