<commit_before># mp3agic [![Build Status](https://travis-ci.org/mpatric/mp3agic.png?branch=master)](https://travis-ci.org/mpatric/mp3agic)

A java library for reading mp3 files and reading / manipulating the ID3 tags (ID3v1 and ID3v2.2 through ID3v2.4).

See [mp3agic-examples](https://github.com/mpatric/mp3agic-examples "mp3agic-examples") for example applications that use this library - including a simple set of command-line tools that perform tasks such including printing mp3 and ID3 details, renaming mp3 files using details from the ID3 tags, retagging mp3 files, attaching images to mp3 files and extracting images from mp3 files.

Releases are available via Maven central. To add a dependency to mp3agic, use:

    <dependency>
      <groupId>com.mpatric</groupId>
      <artifactId>mp3agic</artifactId>
      <version>0.8.1</version>
    </dependency>

## Some features

* 100% Java
* read low-level mpeg frame data
* read, write, add and remove ID3v1 and ID3v2 tags (ID3v2.3 and ID3v2.4)
* read obsolete 3-letter ID3v2.2 tags (but not write them)
* correctly read VBR files by looking at the actual mpeg frames
* read and write embedded images (such as album art)
* add or remove custom messages between the end of the mpeg frames and the ID3v1 tag
* unicode support

## Building

You will need:

* [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html "JDK") 5 or higher
* [maven](http://maven.apache.org/ "maven")

Useful maven goals:

* clean - remove binaries, docs and temporary build files
* compile - compile the library and applications
* test - run all unit tests
* package - package compiled code into a jar

## How to use it

Some sample code follows for performing common operations; it is not an exhaustive list of all the functionality.
More can be learned from looking at the javadocs and at the code itself, or at the examples in [mp3agic-examples](https://github.com/mpatric/mp3agic-examples "mp3agic-examples").

### Opening an mp3 file

        Mp3File mp3file = new Mp3File("SomeMp3File.mp3");
        System.out.println("Length of this mp3 is: " + mp3file.getLengthInSeconds() + " seconds");
        System.out.println("Bitrate: " + mp3file.getLengthInSeconds() + " kbps " + (mp3file.isVbr() ? "(VBR)" : "(CBR)"));<commit_msg>bump java version to 6<commit_after># mp3agic [![Build Status](https://travis-ci.org/mpatric/mp3agic.png?branch=master)](https://travis-ci.org/mpatric/mp3agic)

A java library for reading mp3 files and reading / manipulating the ID3 tags (ID3v1 and ID3v2.2 through ID3v2.4).

See [mp3agic-examples](https://github.com/mpatric/mp3agic-examples "mp3agic-examples") for example applications that use this library - including a simple set of command-line tools that perform tasks such including printing mp3 and ID3 details, renaming mp3 files using details from the ID3 tags, retagging mp3 files, attaching images to mp3 files and extracting images from mp3 files.

Releases are available via Maven central. To add a dependency to mp3agic, use:

    <dependency>
      <groupId>com.mpatric</groupId>
      <artifactId>mp3agic</artifactId>
      <version>0.8.1</version>
    </dependency>

## Some features

* 100% Java
* read low-level mpeg frame data
* read, write, add and remove ID3v1 and ID3v2 tags (ID3v2.3 and ID3v2.4)
* read obsolete 3-letter ID3v2.2 tags (but not write them)
* correctly read VBR files by looking at the actual mpeg frames
* read and write embedded images (such as album art)
* add or remove custom messages between the end of the mpeg frames and the ID3v1 tag
* unicode support

## Building

You will need:

* [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html "JDK") 6 or higher
* [maven](http://maven.apache.org/ "maven")

Useful maven goals:

* clean - remove binaries, docs and temporary build files
* compile - compile the library and applications
* test - run all unit tests
* package - package compiled code into a jar

## How to use it

Some sample code follows for performing common operations; it is not an exhaustive list of all the functionality.
More can be learned from looking at the javadocs and at the code itself, or at the examples in [mp3agic-examples](https://github.com/mpatric/mp3agic-examples "mp3agic-examples").

### Opening an mp3 file

        Mp3File mp3file = new Mp3File("SomeMp3File.mp3");
        System.out.println("Length of this mp3 is: " + mp3file.getLengthInSeconds() + " seconds");
        System.out.println("Bitrate: " + mp3file.getLengthInSeconds() + " kbps " + (mp3file.isVbr() ? "(VBR)" : "(CBR)"));
{'fraction_non_alphanumeric': 0.09984672651631268, 'fraction_numerical': 0.026932340705058025, 'mean_word_length': 4.149943630214205, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 50, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6215314', 'n_tokens_mistral': 1491, 'n_tokens_neox': 1389, 'n_words': 527}