What is the bit depth web audio API?

What is the audio conferencing bit depth of the web audio API?

For example, if you want to create a custom curve to use with WaveShaperNode, what is the appropriate size Float32Array?

I saw developers using 65536, which is designed for 16-bit audio, but I can not find any information in the specification.

+4
source share
1 answer

In fact, the internal system uses Float32, which has a value of 23 bits. Using a floating point avoids most clipping problems, while ensuring good accuracy. This means that technically it makes no sense to try to create a wave curve that exceeds 8388608 (2 ^ 23); but in fact, the 16-bit curve is quite high resolution (signal-to-noise is ~ 96 dB). The big reason for 32-bit audio processing was to avoid clipping problems without improving the I / O SNR; using floating point helps this dramatically. By the way, WaveShaperNode is compressed to [-1, +1] (by the way, most nodes do not work).

In short, just use 16-bit (65535), but make sure your signal is in the range -1, + 1.

+7
source

Source: https://habr.com/ru/post/1502836/


All Articles