2016-10-29 2 views
0

안녕 얘들 아, MP3 파일의 ID3 태그를 보여주는 프로그램을 작성했다. 이제 ID3-TAG에서 write-method를 사용하여 연도 또는 제목과 같은 몇 가지 사항을 변경하고 싶습니다. 그러나 이러한 종류의 클래스를 사용하는 것은 새로운 일이며 사용 방법을 실제로 알지 못합니다.ID3-TAG JAVA FileOutputStream

import java.io.*; 
import java.util.*; 

public class MP3Auslesen { 

    public static void main(String[] args) { 

     long groesseMP3 = 0; 
     byte bTAG[] = new byte[3]; 
     byte bTitel[] = new byte[30]; 
     byte bInterpret[] = new byte[30]; 
     byte bCDTitel[] = new byte[30]; 
     byte bJahr[] = new byte[30]; 
     byte bKommentar[] = new byte[30]; 

     BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); 

     try { 
      System.out.println("MP3-Datei: "); 
      String filename = in.readLine(); 
      FileInputStream fis = new FileInputStream(filename); 

      groesseMP3 = fis.available(); 
      fis.skip(groesseMP3 - 128); 

      fis.read(bTAG); 
      String strTAG = new String(bTAG); 
      fis.read(bTitel); 
      String strTitel = new String(bTitel); 
      fis.read(bInterpret); 
      String strInterpret = new String(bInterpret); 
      fis.read(bCDTitel); 
      String strCDTitel = new String(bCDTitel); 
      fis.read(bJahr); 
      String strJahr = new String(bJahr); 
      String strKommentar = new String(bKommentar); 
      fis.read(bKommentar); 
      byte bGenre = (byte) fis.read(); 

      System.out.println("Dateigröße : " + groesseMP3); 
      System.out.println("TAG : " + strTAG); 
      System.out.println("Titel :" + strTitel); 
      System.out.println("Interpret :" + strInterpret); 
      System.out.println("CD-Titel : " + strCDTitel); 
      System.out.println("Jahr :" + strJahr); 
      System.out.println("Kommentar : " + strKommentar); 
      System.out.println("Genre : " + bGenre); 
      fis.close(); 
     } catch (IOException err) { 
      System.out.println("Fehler" + err); 
     } 
    } 
} 
+0

내 대답에 행운이 있니? –

답변

관련 문제