I want to record data from a microphone using alsa. This command:
int buf[4096];
memset(buf, 0, sizeof(buf));
snd_pcm_readi(capture_handle, buf, avail);
writes the microphone data into the integer buffer buf. ( I am not sure if the data that is written by ..._readi is even integer values, the documentation does'nt tell.)
But if I iterate through the buffer the numbers make no sense. As an example I get that buf[60] == -2,600,000,000 so its smaller than the minimum integer if integer is 32 bit. ( as a note this is not my code but I have to work on it). I want to get the binary values of this whole buffer array and make sense of the values and look up in which way they are saved into the buffer so I can recreate the soundwave with this data.