Writing file from InputStream
to OutputStream
by reading bytes:
File srcFile = new File("c:/src.wav");
File dstFile = new File("c:/dst.wav");
FileInputStream in = new FileInputStream(srcFile);
FileOutputStream out = new FileOutputStream(dstFile);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
And here are some already answered questions on splitting wav channels, may be of use:
- How to split a Wav file into channels in java?
- wav amplitude in java (stereo or more channels)