Converting a 8 bit PCM to 16 bit PCM

前端 未结 1 1602
感情败类
感情败类 2021-01-03 15:41

Starting from this question I was made to understand how to deinterleave the left and right channel of a 16 bit PCM data.

My question now is, how will a 8 bit PCM be

相关标签:
1条回答
  • 2021-01-03 16:24

    16-bit PCM has basically the same data bits and additional bits on the least significant bit side to specify the value and add accuracy and detail. Then 8-bit PCM is typically unsigned value with a centerpoint of 0x80, and 16-bit (also applicable to higher bitnesses) PCM is signed integer, so the conversion formula is:

    UINT8 sample8 = ...;
    INT16 sample16 = (INT16) (sample8 - 0x80) << 8;
    
    0 讨论(0)
提交回复
热议问题