简体   繁体   English

将每个样本 8 位音频编码为每个样本 2 位的方法

[英]Way to encode 8-bit per sample audio into 2-bits per sample

如果 ADPCM 可以将每个样本的 16 位音频存储为每个样本的 4 位,有没有办法将每个样本的 8 位音频存储为每个样本的 2 位?

The G.726 standard supercedes G.721 and G.723 into a single standard, and adds 2-bit ADPCM to the 3- 4- and 5-bit modes from older standards. G.726 标准取代 G.721 和 G.723 成为单一标准,并将 2 位 ADPCM 添加到来自旧标准的 3 位和 5 位模式。 These are all very simple and fast to encode/decode.这些都是非常简单和快速的编码/解码。 There appears to be no file format for the 2-bit version, but there is a widely re-used open source Sun library to encode/decode the formats; 2 位版本似乎没有文件格式,但有一个广泛重复使用的开源 Sun 库来编码/解码格式; SpanDSP is just one library that includes the Sun code. SpanDSP只是一个包含 Sun 代码的库。 These take 16-bit samples as input but it is trivial to convert 8-bit to 16-bit.这些将 16 位样本作为输入,但将 8 位转换为 16 位是微不足道的。

If you want to hear the 2-bit mode you may have to write your own converter that calls into the library.如果您想听到 2 位模式,您可能需要编写自己的转换器来调用库。

There's also ADPCM specifications from long ago like "ADPCM Creative Technology" that support low bit rates and sample sizes.还有很久以前的 ADPCM 规范,例如支持低比特率和样本大小的“ADPCM 创意技术”。

See also the Sox documentation about various old compression schemes.另请参阅有关各种旧压缩方案的Sox 文档

The number of bits per sample is not strictly related to the dynamic range or number of bits in the output.每个样本的位数与输出中的动态范围或位数并不严格相关。 For example, the https://en.wikipedia.org/wiki/Direct_Stream_Digital format used in Super Audio CD achieves high quality with only 1 bit per sample, but at a 2.8224 MHz sample rate.例如,超级音频 CD 中使用的https://en.wikipedia.org/wiki/Direct_Stream_Digital格式实现了高质量,每个样本只有 1 位,但采样率为 2.8224 MHz。

As far I know, ADPCM compression standard needs 4-bits per sample even if the original uncompressed audio has 8-bit audio samples.据我所知,即使原始未压缩音频具有 8 位音频样本,ADPCM 压缩标准也需要每个样本 4 位。 Hence there is NO way to encode audio using 2-bit per sample with ADPCM.因此,没有办法使用 ADPCM 对每个样本使用 2 位编码音频。

EDIT: I am specifically referring to G.726 , which is one of the widely supported speech compression standard in WAV.编辑:我特别指的是 G.726 ,它是 WAV 中广泛支持的语音压缩标准之一。 Personally, I am not aware of freely available G.727 codec.就个人而言,我不知道免费提供的 G.727 编解码器。 FFMPEG is one of the libraries with extensive support for audio codecs. FFMPEG 是对音频编解码器提供广泛支持的库之一。 You can see the audio codec list supported by them at https://www.ffmpeg.org/general.html#Audio-Codecs .您可以在https://www.ffmpeg.org/general.html#Audio-Codecs 上查看它们支持的音频编解码器列表。 In the list, I do see support for other ADPCM formats, which may be worth exploring.在列表中,我确实看到了对其他 ADPCM 格式的支持,这可能值得探索。

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

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