AudioUnitSampleType is a SInt32. When I log it to the console I get readings roughly between -22000 and 22000.
Can someone explain what those values represent? How do they describe the wave form? I suppose because they are positive and negative that the axis is in the center of the wave form.
How would I convert the values to decibel such that 0 dB is loudest?
Although the sample type is a 32-bit int, the values you received will generally fit in a 16-bit int (ie, 32767..-32767). 32767 (or floating point 1.0) corresponds to 0dB.
After converting the sample to floating point value, the power in decibels looks something like this:
I’ve done the above calculations as double precision to avoid overflow.