| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 716 人关注过本帖
标题:[求助]看一下AU格式转换为WAV格式的头文件哪里错了
只看楼主 加入收藏
bluelance
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-7-19
收藏
 问题点数:0 回复次数:0 
[求助]看一下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();
}

}

搜索更多相关主题的帖子: WAV 格式 文件 
2006-07-19 16:58
快速回复:[求助]看一下AU格式转换为WAV格式的头文件哪里错了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016778 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved