Search in sources :

Example 1 with Mp3File

use of com.mpatric.mp3agic.Mp3File in project stanbol by apache.

the class MP3FileExtractor method performExtraction.

@Override
protected void performExtraction(URI arg0, File arg1, Charset arg2, String arg3, RDFContainer result) throws ExtractorException {
    try {
        Mp3File mp3File = new Mp3File(arg1.toString());
        ID3v1 id3v1 = mp3File.getId3v1Tag();
        ID3v2 id3v2 = mp3File.getId3v2Tag();
        ID3Wrapper wrapper = new ID3Wrapper(id3v1, id3v2);
        addId3Fields(wrapper, result);
        result.add(RDF.type, NID3.ID3Audio);
    } catch (UnsupportedTagException e) {
        throw new ExtractorException(e);
    } catch (InvalidDataException e) {
        throw new ExtractorException(e);
    } catch (IOException e) {
        throw new ExtractorException(e);
    }
}
Also used : ID3v2(com.mpatric.mp3agic.ID3v2) Mp3File(com.mpatric.mp3agic.Mp3File) ID3v1(com.mpatric.mp3agic.ID3v1) ID3Wrapper(com.mpatric.mp3agic.ID3Wrapper) ExtractorException(org.semanticdesktop.aperture.extractor.ExtractorException) InvalidDataException(com.mpatric.mp3agic.InvalidDataException) UnsupportedTagException(com.mpatric.mp3agic.UnsupportedTagException) IOException(java.io.IOException)

Aggregations

ID3Wrapper (com.mpatric.mp3agic.ID3Wrapper)1 ID3v1 (com.mpatric.mp3agic.ID3v1)1 ID3v2 (com.mpatric.mp3agic.ID3v2)1 InvalidDataException (com.mpatric.mp3agic.InvalidDataException)1 Mp3File (com.mpatric.mp3agic.Mp3File)1 UnsupportedTagException (com.mpatric.mp3agic.UnsupportedTagException)1 IOException (java.io.IOException)1 ExtractorException (org.semanticdesktop.aperture.extractor.ExtractorException)1