I'm building a soft audio volume control. What is the best C syntax to use UC3A3 hardware in a fast and convenient way?
Basically, I'm doing A = A * V/C + D, where:
A = signed 32-bit audio sample where upper 24 bits are sent to DAC chip
V = volume variable, 16 or 32-bit signed or unsigned
C = scaling constant so that max(V/C) = 1
D = random dither applied in lower 8 bits of A prior to truncating