Skip to content

beckchr/ithaka-audioinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ithaka Audio Info

Ithaka Audio Info provides a simple way to extract meta (tag) information from audio files. Ithaka Audio Info requires Java 7 or later.

Features

  • Supports MP3 (ID3v1 + ID3v2) and M4A (AAC + ALAC)
  • Easy to use
  • Fast...

Usage

Here's a brief introduction the core interfaces and classes.

As you can see, the abstract class AudioInfo has concrete subclasses M4AInfo and MP3Info.

Create an M4AInfo like this:

File m4aFile = new File("sample.m4a");

try (InputStream input = new BufferedInputStream(new FileInputStream(m4aFile))) {
	AudioInfo audioInfo = new M4AInfo(input);
	...
} catch (Exception e) {
	...
}

Create an MP3Info like this:

File mp3File = new File("sample.mp3");

try (InputStream input = new BufferedInputStream(new FileInputStream(mp3File))) {
	AudioInfo audioInfo = new MP3Info(input, mp3File.length());
	...
} catch (Exception e) {
	...
}

This will examine ID3 tags (ID3v2 as well as ID3v1) and calculate duration by analyzing the audio frames. If you just want to examine ID3v2, you can use ID3v2Info instead. The input stream must support the mark/reset methods (which is the case for BufferedInputStream).

Class AudioInfo provides the following properties:

String brand;		// brand, e.g. "M4A", "MP3", ...
long duration;		// track duration (milliseconds)
String title;		// track title
String artist;		// track artist
String albumArtist;	// album artist
String album;		// album title
short year;			// year
String genre;		// genre name
String comment;		// comment
short track;		// track number
short tracks;		// number of tracks
short disc;			// disc number
short discs;		// number of discs
String copyright;	// copyright notice
String composer;	// composer name
String grouping;	// track grouping
boolean compilation;// compilation flag
String lyrics;		// song lyrics
byte[] cover;		// cover image data

Downloads

Add Maven repository

<repository>
	<id>ithaka</id>
	<url>http://beckchr.github.com/ithaka-maven/mvnrepo/</url>
</repository>

as well as dependency

<dependency>
	<groupId>de.odysseus.ithaka</groupId>
	<artifactId>ithaka-audioinfo</artifactId>
	<version>1.0</version>
</dependency>

or manually grab latest JARs here.

License

Ithaka Audio Info is available under the Apache License, Version 2.0.

(c) 2014 Odysseus Software

About

Get Tag Info from MP3 and M4A Files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages