I have just tried the example code and it is working fine.
How can i generate the .wav file from the recorded data. is there any documentation on that.
Not really, but in theory you could esptool.py to extract the data on the partition where the sound was recorded, then use a program like Sox to convert from raw data to wav. Or you could modify the example itself to write a wav header to the output data; the wav file format is not that hard to generate a header for.