After I've converted the audio data(which I obtained from reading the microphone, and with the format of 44.1k hz/16 bit/mono) into a byte array, how would I determine the frequency/volume of the audio data from just analyzing the byte array I've read?
Currently this is what I have so far, the data comes in 16 bits, so I look at the byte array 2 bytes at a time, often it looks like this when it's general quiet:
-1
-45
-1
-55
-1
-62
-1
-64
-1
-63
-1
-60
-1
-56
-1
-54
-1
-50
-1
-47
-1
-42
-1
-38
When there's sound that's picked up by the microphone the byte data looks like this:
14
80
14
85
14
84
14
92
14
102
14
118
14
-112
14
-75
14
-35
And if i convert every 2 bytes into a short, I have a correlation(not perfect at all, seems to have some relationship with the frequency as well) between the value of the short and the loudness of the sound.
Can anyone with a knowledge of how audio data is stored shed some light on how to interpret the audio data?