Thanks MadeInGermany, I will try this out on my main code.
I limited the DEMO to 6000Hz because it kept the BYTE manipulation easy to understand using only one little endian word per sample and byterate instead of the two little endian words for both. Also 8 bits unsigned per sample, and mono eliminates the need for other sections to be altered.
As an addendum the WAV file format:
Microsoft WAVE soundfile format