[求助]帮我看下AU格式转换为WAV格式的头文件哪里错了
谢谢大家
就是头文件错误
其他都对的
package autowav;
import java.io.*;
//import autowav.Datas;
/**
* <p>Title: VoiceToMail</p>
* <p>Description: VoiceToMail,语音文件到E-Mail</p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: Microsys</p>
* @author Geffer Yhean (engine)
* @version v1.0
*/
public class towav {
public towav() {
}
public static void main(String[] args) throws Exception {
String biaozhi1 = new String("RIFF");
byte[] biaozhi11 = biaozhi1.getBytes();
int changdu;
String biaozhi2 = new String("WAVE");
byte[] biaozhi22 = biaozhi1.getBytes();
String biaozhi3 = new String("fmt");
byte[] biaozhi33 = biaozhi1.getBytes();
byte[] buding = new byte[34];
buding[0] = 12;
buding[1] = 0;
buding[2] = 0;
buding[3] = 0;
buding[4] = 06;
buding[5] = 0;
buding[6] = 01;
buding[7] = 0;
buding[8] = 40;
buding[9] = 0x1F;
buding[10] = 0;
buding[11] = 0;
buding[12] = 40;
buding[13] = 0x1F;
buding[14] = 0;
buding[15] = 0;
buding[16] = 01;
buding[17] = 0;
buding[18] = 8;
buding[19] = 0;
buding[20] = 0;
buding[21] = 0;
buding[22] = 66;
buding[23] = 61;
buding[24] = 63;
buding[25] = 74;
buding[26] = 04;
buding[27] = 0;
buding[28] = 0;
buding[29] = 0;
buding[30] = (byte) 0xF4;
buding[31] = 66;
buding[32] = 04;
buding[33] = 0;
String biaozhi4 = "data";
byte[] biaozhi44 = biaozhi4.getBytes();
int shujuchangdu;
int count = 0;
File f = new File("c:\\aa.au");
FileInputStream fis = new FileInputStream(f);
byte[] b = new byte[ (int) f.length()];
fis.read(b);
for (int i = 0; i < f.length(); i++) {
//System.out.print(b[i]);
count++;
}
System.out.println("countttttttttttt:" + count);
changdu=count+42;
shujuchangdu = count;
String bb = new String(b);
System.out.println(bb);
boolean a = true;
File ff = new File("c:\\cc.wav");
FileOutputStream fos = new FileOutputStream(ff, a);
fos.write(biaozhi11);
fos.write(changdu);
fos.write(biaozhi22);
fos.write(biaozhi33);
for (int j = 0; j < 34; j++) {
fos.write(buding[j]);
}
fos.write(biaozhi44);
//fos.write(shujuchangdu);
fos.write(b);
/*
String abc = "abc";
byte[] ab = abc.getBytes();
fos.write(ab);
*/
fis.close();
fos.close();
towav towav1 = new towav();
}
}