Package org.jaudiotagger.audio.mp4

Examples of org.jaudiotagger.audio.mp4.Mp4FileReader


        test(new PCMFileReader(), "testfiles/uncompressed/sample.wav");
    }

    @Test
    public void testAAC() {
        test(new MP4FileReader(), "testfiles/aac/sample_faac.mp4");
        test(new MP4FileReader(), "testfiles/aac/sample_ffmpeg.mp4");
        test(new MP4FileReader(), "testfiles/aac/sample.mp4");
        test(new MP4FileReader(), "testfiles/aac/sample_nero.mp4");
        test(new MP4FileReader(), "testfiles/aac/sample_itunes.m4a");
        test(new MP4FileReader(), "testfiles/aac/sample_itunes_new.m4a");
    }
View Full Code Here


        test(new MP4FileReader(), "testfiles/aac/sample_itunes_new.m4a");
    }

    @Test
    public void testALAC() {
        test(new MP4FileReader(), "testfiles/alac/sample_ffmpeg.m4a");
        test(new MP4FileReader(), "testfiles/alac/sample_dbpoweramp.m4a");
    }
View Full Code Here

* Date: 11.08.2009
*/
public class MP4FileReader extends AudioFileReader {
    @Override
    public Track readSingle(Track track) {
        Mp4FileReader reader = new Mp4FileReader();
        try {
            org.jaudiotagger.audio.AudioFile audioFile = reader.read(track.getTrackData().getFile());
            copyHeaderFields((GenericAudioHeader) audioFile.getAudioHeader(), track);
            org.jaudiotagger.tag.Tag tag = audioFile.getTag();
            copyCommonTagFields(tag, track);
            copySpecificTagFields(tag, track);
        } catch (Exception e) {
View Full Code Here

        // Tag Readers
        readers.put(SupportedFileFormat.OGG.getFilesuffix(), new OggFileReader());
        readers.put(SupportedFileFormat.FLAC.getFilesuffix(), new FlacFileReader());
        readers.put(SupportedFileFormat.MP3.getFilesuffix(), new MP3FileReader());
        readers.put(SupportedFileFormat.MP4.getFilesuffix(), new Mp4FileReader());
        readers.put(SupportedFileFormat.M4A.getFilesuffix(), new Mp4FileReader());
        readers.put(SupportedFileFormat.M4P.getFilesuffix(), new Mp4FileReader());
        readers.put(SupportedFileFormat.M4B.getFilesuffix(), new Mp4FileReader());
        readers.put(SupportedFileFormat.WAV.getFilesuffix(), new WavFileReader());

        // Tag Writers
        writers.put(SupportedFileFormat.OGG.getFilesuffix(), new OggFileWriter());
        writers.put(SupportedFileFormat.FLAC.getFilesuffix(), new FlacFileWriter());
View Full Code Here

        // Tag Writers
        writers.put(SupportedFileFormat.OGG.getFilesuffix(), new OggFileWriter());
        writers.put(SupportedFileFormat.FLAC.getFilesuffix(), new FlacFileWriter());
        writers.put(SupportedFileFormat.MP3.getFilesuffix(), new MP3FileWriter());
        writers.put(SupportedFileFormat.MP4.getFilesuffix(), new Mp4FileWriter());
        writers.put(SupportedFileFormat.M4A.getFilesuffix(), new Mp4FileWriter());
        writers.put(SupportedFileFormat.M4P.getFilesuffix(), new Mp4FileWriter());
        writers.put(SupportedFileFormat.M4B.getFilesuffix(), new Mp4FileWriter());
        writers.put(SupportedFileFormat.WAV.getFilesuffix(), new WavFileWriter());

        // Register modificationHandler
        for (AudioFileWriter curr : writers.values()) {
            curr.setAudioFileModificationListener(this.modificationHandler);
View Full Code Here

        this.content = content;
    }

    protected void build(ByteBuffer data) throws UnsupportedEncodingException {
        //Data actually contains a 'Data' Box so process data using this
        Mp4BoxHeader header = new Mp4BoxHeader(data);
        Mp4DataBox databox = new Mp4DataBox(header, data);
        dataSize = header.getDataLength();
        content = databox.getContent();
    }
View Full Code Here

    protected byte[] getDataBytes() throws UnsupportedEncodingException {
        return dataBytes;
    }

    protected void build(ByteBuffer raw) {
        Mp4BoxHeader header = new Mp4BoxHeader(raw);
        dataSize = header.getDataLength();

        //Skip the version and length fields
        raw.position(raw.position() + Mp4DataBox.PRE_DATA_LENGTH);

        //Read the raw data into byte array
View Full Code Here

    }


    protected void build(ByteBuffer data) throws UnsupportedEncodingException {
        //Data actually contains a 'Data' Box so process data using this
        Mp4BoxHeader header = new Mp4BoxHeader(data);
        Mp4DataBox databox = new Mp4DataBox(header, data);
        dataSize = header.getDataLength();
        numbers = databox.getNumbers();

        //Track number always hold three values, we can discard the first one, the second one is the track no
        //and the third is the total no of tracks so only use if not zero
        StringBuffer sb = new StringBuffer();
View Full Code Here

        return Mp4FieldType.IMPLICIT;
    }

    protected void build(ByteBuffer data) throws UnsupportedEncodingException {
        //Data actually contains a 'Data' Box so process data using this
        Mp4BoxHeader header = new Mp4BoxHeader(data);
        Mp4DataBox databox = new Mp4DataBox(header, data);
        dataSize = header.getDataLength();
        content = databox.getContent();
        numbers = databox.getNumbers();
    }
View Full Code Here

        numbers.add((short) (1));
    }

    protected void build(ByteBuffer data) throws UnsupportedEncodingException {
        //Data actually contains a 'Data' Box so process data using this
        Mp4BoxHeader header = new Mp4BoxHeader(data);
        Mp4DataBox databox = new Mp4DataBox(header, data);
        dataSize = header.getDataLength();
        numbers = databox.getNumbers();

        int genreId = numbers.get(0);
        //Get value, we have to adjust index by one because iTunes labels from one instead of zero
        content = GenreTypes.getInstanceOf().getValueForId(genreId - 1);
View Full Code Here

TOP

Related Classes of org.jaudiotagger.audio.mp4.Mp4FileReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.