Expand description
Interleaved 16-bit PCM with the measurements pydub exposes.
Every formula here is pydub’s, which is audioop’s underneath, and the
integer truncation is load-bearing: rms is an int, so dBFS is the
log of a rounded-down value, not of the true RMS. Reproducing the
rounding matters more than being more accurate.
Structs§
- Pcm
- Interleaved
i16samples plus the format they were decoded at.
Constants§
- MAX_
POSSIBLE_ AMPLITUDE - Sample width is always 2 in this pipeline; pydub’s
max_possible_amplitudeis2^16 / 2.
Functions§
- py_
round 🔒 - Python’s
round()— half away from zero is not what it does; it is banker’s rounding, so 0.5 goes to 0 and 1.5 goes to 2. - ratio_
to_ db pydub.utils.ratio_to_dbin amplitude mode,-infat zero. Seecrate::segment::ratio_to_dbfor why this is notlog10.