我正在使用一些算法,这些算法需要用字节数组表示的数据,在处理文本文件时没有问题,但我不知道如何将声音文件放入这种数组中。我没有指定那个声音文件的扩展名,所以它可以是最简单的。So:如何将声音文件放入Java中的字节数组?
谢谢。
发布于 2012-09-25 23:39:24
那么:如何将声音文件放入Java中的字节数组?
File f = new File(soundFilePath, soundFileName);
byte[] soundFileByteArray = new byte[f.length()];
FileInputStream fis = new FileInputStream(f);
fis.read(soundFileByteArray);https://stackoverflow.com/questions/12592522
复制相似问题