Added code to build a WAV file