Fixed overflow for sample value of 1

If sample value is 1, it should be encoded as 32767 not 32768
Merge pull request #1 from notthetup/patch-1

Fixed wrap around for sample value of 1