Original Post
My data comes as a stream of bytes out of a wavefile: byte0 = low order sample0 L byte1 = high order sample0 L byte2 = low order sample0 R byte3 = high order sample0 R byte4 = low order sample1 L byte5 = high order sample1 L byte6 = low order sample1 R byte7 = high order sample1 R etc... byte1 and byte0 make up one 16 bit signed word. I'd like to convert these bytes into an integer in the range -32768 -> 32767. I'd also like to convert them back to put back into the stream... Can anyone help me figure out how to do this in C? Thanks!