WAV file creation improvements

- added basic recording function
- improved the file creation code slightly
- added ability to set very large buffer during recording