简体   繁体   English

将8位PCM转换为16位PCM

[英]Converting a 8 bit PCM to 16 bit PCM

Starting from this question I was made to understand how to deinterleave the left and right channel of a 16 bit PCM data. 这个问题开始,我开始了解如何对16位PCM数据的左右声道进行解交织。

My question now is, how will a 8 bit PCM be deinterleaved and "stretched" into a 16 bit value 我现在的问题是,如何将8位PCM解交织并“拉伸”为16位值

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. 16位PCM在最低有效位一侧具有基本相同的数据位和附加位,以指定值并增加精度和细节。 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: 然后,8位PCM 通常是一个无符号值,中心点为0x80 ,而16位(也适用于更高的位数)PCM是有符号整数,因此转换公式为:

UINT8 sample8 = ...;
INT16 sample16 = (INT16) (sample8 - 0x80) << 8;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM