I don't know how to write short arrays generated inside of while loop into a bigger array outside of while loop. I want to make them concatenated like so [first iteration, second iteration, third iteration...etc].

i tired making a big array and putting values in by remembering the last position but the application crashes

byte audioData[] = new byte[1024];
while (isRecording) {
    recorder.read(audioData, 0, 1024);

    // Converting from byte array to short array 
    short[] audioDataF = byteToShort(audioData);

    for (int i = 0; i < audioDataF.length; i++) {
        realdata[positionsaver * audioDataF.length +i]= audioDataF[i];
    }
    positionsaver++;          
}

I would like to have an array of PCM data but my app crashes :<

0 Answers