1
votes

How can I convert an unsigned 8bit PCM stream (0-255) into a signed 8bit PCM stream (-128-127). Is it as simple as subtracting 128 from every unsigned byte so that 0 becomes -128 and 255 becomes 127? Or is it more complicated? Thanks!

2
Maybe you should add the tag of the programming language you want to use to solve this problem.Nobody moving away from SE

2 Answers

0
votes

Why dont you try it? In my opinion it should suffice but I don't know what language you are using.

When working with signed and unsigned integer/char bear in mind that the internal representation for negative values is the two's complement. Safest would be to calculate in signed int size to avoid overflows.

0
votes

For the code you posted in your comment, subtracting 128 will reverse the previous operation and will give you the signed data.