i think i might be able to use the code you provided if i remove the header from the WAV file and apply it to the rest of the file. however, i am afraid it might produce the same strange results if the problem is that Audacity is putting something strange in the file. i will certainly give it a try when i have some time.