转换一个8位PCM到16位PCM [英] Converting a 8 bit PCM to 16 bit PCM

查看:2825
本文介绍了转换一个8位PCM到16位PCM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题我是为了了解如何去交织一个16位PCM数据的左和右声道。

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

我现在的问题是,如何将一个8比特PCM去交织被和延伸到一个16位值

My question now is, how will a 8 bit PCM be deinterleaved and "stretched" into a 16 bit value

推荐答案

16位PCM基本上对至少显著位侧相同的数据位和附加位指定值,并添加准确性和细节。随后的8位PCM是通常无符号的价值与的中心点0x80的,和16位(也适用于更高bitnesses)的PCM符号整数,所以换算公式是:

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;

这篇关于转换一个8位PCM到16位PCM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆