【发布时间】:2016-10-29 12:39:03
【问题描述】:
大家好,我编写了一个程序,可以显示 MP3.file 的 ID3-Tag。 现在我想通过使用 write-method 更改 ID3-TAG 中的一些内容,例如年份或标题。但我是新手,不知道如何使用它们。
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);
}
}
}
【问题讨论】:
-
我的回答好运吗?
标签: java fileoutputstream id3