Im trying to insert some result arrays to a 2d array. but at the end i only get all the 2d arrays with the set of last array i inserted in to the 2d array. when i debug and check the code i found that every time i do this action bmma[il]=number; the bmma array's all arrays changes with the newly assigning values.
here is the full code i implemented.
double[][] newDATA ;
double [][] bmma = new double[100][];
double [] number = new double[12];
int il=0;
String fname = "newAudio.wav";
RawAudioFileStream rawAudio = new RawAudioFileStream(fname);
StreamHeader mh = mfccm.init(rawAudio.getHeader());
MatrixFileStream out = new MatrixFileStream(fname + ".txt", true);
out.setMultiLine(true);
out.setHeader(mh);
while (true) {
StreamFrame f = mfccm.process(rawAudio.recvFrame());
if (f == null) {
break;
}
if(((MatrixHeader.MatrixFrame)f).data != null){
for (int i=0;i<12;i++){
newDATA=((MatrixHeader.MatrixFrame)f).data;
number[i]=newDATA[i][0];
}
bmma[il]=number;
il++;
}
Any help will be highly appreciated to overcome this issue.