What kind of data is this?
You'll have to check the specs on the microphone. I assume it's up to you "clock" the data at your chosen sample rate.
If you want to make a [u]WAV file[/u], it's just a 44-byte header followed by your audio samples.
You'll probably have to re-format/re-arrange the bytes to get them in the correct order unless the microphone is spitting-out 8-bit data. However, 8-bit WAVs use unsigned integers, whereas 16 & 24-bit WAVs use signed integers so you may have to sort that out too.
In an application like this it's usually easy to write the header because you're probably always writing the same format (44.1kHz, 16-bit, mono, etc.).
However, when you read the header you usually have to parse/decode it, at least to check that it matches what you expect. And, in some cases you may have to re-sample the data to match the sample-rate and bit-depth of your playback hardware.
How can I make a wav or better mp3 or ogg from this stream. Is this possible with a Cortex M0 board?
I don't know if that processor is fast enough but LAME (for MP3) is open source (and the MP3 patents expired about a year ago) and OGG is open source, but you might have to "port" the code for your processor.