This project has moved and is read-only. For the latest updates, please go here.

Saving unsigned PCM 8 bit to Wav is Noisy

Jun 12, 2016 at 4:08 PM
I have recorded PCM 8000 Hz , 1 Channel ,8 bits from telephone device. I am then using the stream to WaveFileWriter to save it then to Wave file. the issue is that the generated audio file is very noisy. to Investigate I made :

1- Open PCM to other application , when try to set PCM to "unsigned" , i get the same noisy data as the wav file generated by NAudio. When I set the PCM as "Signed" , i get clear audio data.

2- When i open the PCM bytes, it is unsigned , ie data are from 0-255

my code for save the PCM stream is :

Private Mywriter As WaveFileWriter
Mywriter = New WaveFileWriter("D:\xxx.wav", New WaveFormat(8000, 8, 1)
Mywriter.Write(Buffer, 0, Buffer.Length) ' after receiving the PCM stream
Mywriter.Close() ' to push the wav file

kindly advice
Jun 25, 2016 at 5:03 PM
I'm afraid I do not know what the issue is here. Are you sure it's linear PCM. Also, bytes in a file are neither signed nor unsigned. They are just 8 bits of data, and whether you treat them as signed or unsigned is the decision of the reader of the file.