Jé Queue
Jé Queue

Reputation: 10637

What is the byte format of an 8-bit monaural WAV file?

Setup: WAV 8bit 8kHz mono PCM file.

By spec, 8-bit bytes are unsigned [0,255]. Is the byte value 2's compliment? Is it simply binary offset? What EXACTLY is the byte format?

MSDN says the byte is in 2's compliment. Yet, DSP discussions say binary offset, meaning zero amplitude is 127?

Upvotes: 1

Views: 2974

Answers (1)

jaket
jaket

Reputation: 9341

8-bit WAV is the only format which is unsigned. The linked MSDN blog is wrong. I can verify this from experience and also the wikipedia page for WAV files https://en.wikipedia.org/wiki/WAV has a mention.

So if you were to consider a full scale sine wave, the zero crossing would be at 127, the positive peak would be at 255, and the negative peak would be at 0 or 1, depending on implementation (although you should account for the possibility of it being zero)

Upvotes: 4

Related Questions