It can be a bit of a complicated thing, since the audio needs to be sampled consistently, generally at a fairly high rate, and written to a file at the same time. I am not an expert in any way with programming on the Due, so can't help a whole lot there, but have worked a bit with wav files on smaller arduinos.
If you take a look at https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ , there is a good visual and technical description of the header. You basically need to write a header, then just add the raw audio sample data after that. The Due can also do 12-bit audio sampling, but it might be easier to start with 8-bit samples, since it only requires one byte per sample.
From my experience, the biggest challenges are getting quality samples at the correct sample rates, and writing to SD card etc with enough speed and/or a big enough data buffer, but this should be much easier on the Due since it has more memory and a faster processor.