I am having issues trying to add multiple byte arrays to one. I am not talking about concatenating here. I need to add individual items of the Byte[]. This is what i am looking for.
byte[] one = [4,5,6];
byte[] two = [1,2,1];
The result should be
byte[] sum = [5,7,7];
This is just a simple example. I am writing my own algorithm to mix different pcm recordings in android. This is where i am stuck at. any help would be much appreciated.
UPDATE:
Here is my code snippet:
while(stream[1].read()!=-1) {
List<byte[]> arrayColl = new ArrayList<byte[]>();
for(int i =0; i<recfiles.length; i++) {
stream[i].read(buffer);
arrayColl.add(buffer);
}
}
There can be multiple stream based on users selection. The loop above will read multiple streams in a buffer and that buffer is added to an ArrayList. Now what i need to do is to mix the bytes in the arraylist in a way i mentioned above. The buffer is a byte[]