private void fillHeaderInfo() {
   // audio header info
   bitRate = audioHeader.getBitRate();
   bitsPerSample = Integer.toString(audioHeader.getBitsPerSample());
   trackLength = Integer.toString(audioHeader.getTrackLength());
   encodingType = audioHeader.getEncodingType();
   format = audioHeader.getFormat();
   sampleRate = audioHeader.getSampleRate();
 }
Esempio n. 2
0
 private void insertMusicMetadata() throws IOException {
   atts.reset();
   System.out.format("Extracting music metadata from %s.\n", src.path());
   Tag tags = audio.getTag();
   AudioHeader header = audio.getAudioHeader();
   insert(FORMAT, header.getFormat());
   insert(ENCODINGTYPE, header.getEncodingType());
   insert(BITRATE, header.getBitRate());
   insert(SAMPLERATE, header.getSampleRate());
   insert(LENGTH, header.getTrackLength());
   insert(ALBUM, tags.getFirst(FieldKey.ALBUM));
   insert(ALBUMARTIST, tags.getFirst(FieldKey.ALBUM_ARTIST));
   insert(ARTIST, tags.getFirst(FieldKey.ARTIST));
   insert(TITLE, tags.getFirst(FieldKey.TITLE));
   insert(TRACKNR, tags.getFirst(FieldKey.TRACK));
   insert(DISCNR, tags.getFirst(FieldKey.DISC_NO));
   insert(YEAR, tags.getFirst(FieldKey.YEAR));
   insert(COMMENT, tags.getFirst(FieldKey.COMMENT));
 }
  public void printResults() {
    System.out.println("\n<-- ALL TAG INFO -->");
    System.out.println("ARTIST: " + artist);
    System.out.println("TITLE: " + title);
    System.out.println("ALBUM: " + album);
    System.out.println("ALBUM ARTIST: " + album_artist);
    System.out.println("TRACK: " + track);
    System.out.println("COMPOSER: " + composer);
    System.out.println("YEAR: " + year);
    System.out.println("DISK NO: " + diskNumber);

    System.out.println("\n<-- ALL AUDIO HEADERS -->");
    System.out.println("BIT RATE: " + audioHeader.getBitRate());
    System.out.println("BITS PER SAMPLE: " + audioHeader.getBitsPerSample());
    System.out.println("TRACK LENGTH: " + audioHeader.getTrackLength());
    System.out.println("ENCODING TYPE: " + audioHeader.getEncodingType());
    System.out.println("FORMAT: " + audioHeader.getFormat());
    System.out.println("SAMPLE RATE: " + audioHeader.getSampleRate());
  }