Audio data from microphone

I am trying to make sure audio from Edge microphone is correct. I wanted to print out a short audio sequence, save it to a wav file and play it.

I used the following project:

https://github.com/sparkfun/SparkFun_Ap … fft/main.c

and modified it a bit, like I save the data from “g_ui32PDMDataBuffer” as it is in the buffer and create a wav file out of it. So I printed the buffer on logger and copy pasted the values to a file, and finally created a wav file with a Python script. Does this make sense? Should I be able to play the audio in this case and hear the correctly the audio or I am missing some data conversion? I tried this but the audio in my file is totally wrong, and I wonder where the problem is…

Is there an easier method to do this?