Converting a 8 bit PCM to 16 bit PCM

爷,独闯天下 提交于 2019-12-09 13:58:03

问题


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 deinterleaved and "stretched" into a 16 bit value


回答1:


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;


来源:https://stackoverflow.com/questions/24449957/converting-a-8-bit-pcm-to-16-bit-pcm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!