简体   繁体   中英

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. 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; SpanDSP is just one library that includes the Sun code. These take 16-bit samples as input but it is trivial to convert 8-bit to 16-bit.

If you want to hear the 2-bit mode you may have to write your own converter that calls into the library.

There's also ADPCM specifications from long ago like "ADPCM Creative Technology" that support low bit rates and sample sizes.

See also the Sox documentation about various old compression schemes.

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.

As far I know, ADPCM compression standard needs 4-bits per sample even if the original uncompressed audio has 8-bit audio samples. Hence there is NO way to encode audio using 2-bit per sample with ADPCM.

EDIT: I am specifically referring to G.726 , which is one of the widely supported speech compression standard in WAV. Personally, I am not aware of freely available G.727 codec. FFMPEG is one of the libraries with extensive support for audio codecs. You can see the audio codec list supported by them at https://www.ffmpeg.org/general.html#Audio-Codecs . In the list, I do see support for other ADPCM formats, which may be worth exploring.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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