I am reading a .wav audio file using Java AudioInputStream.The audio file is 16 bit PCM signed, with samplerate = 44100, framesize = 2, framelength= 114048. I managed to get the Audio data in the form of a byte array but I am not sure how much size should I assign to this byte array so that I can convert it to floatinf point values. I am doing some audio manipulation using Goertzel algorithm which takes input of float array, something like "float[] x". Below is some code fragment that I am using. Thanks in advance.
try {
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(fileIn);
}
while ( numBytesRead != -1) {
numBytesRead = audioInputStream.read(audioBytes);
// Logic goes here
floatValue = byteArrayToFloat(audioBytes);
}