當前位置:編程學習大全網 - 網站源碼 - java音頻文件的讀寫

java音頻文件的讀寫

File?file?=?new?File("src.amr");

byte[]?bts?=?new?byte[1024];

int?length?=?0;

try?{

InputStream?stream?=?new?FileInputStream(file);

OutputStream?os?=?new?FileOutputStream(new?File("dest.amr"));

while?((length?=?stream.read(bts))?>?0)?{

os.write(bts,?0,?length);

}

os.flush();

os.close();

stream.close();

}?catch?(Exception?e)?{

e.printStackTrace();

}

  • 上一篇:源代碼版權修改
  • 下一篇:什麽書是價值線?
  • copyright 2024編程學習大全網