Audio Tools / Volume Peak

franz's picture

Hi, what's the maximum value of the volume peak ? The data sould be .float normalized (0->1), however i got values higher than 1... thanx

cwright's picture
CoreAudio

It should be, but values higher than 1 are both possible and common. Normalizing requires knowing what the peak can be, but the documentation doesn't tell us.

From what I've seen, it depends upon the "Volume" setting for the input in Audio MIDI Setup -- if Volume is 0, the maximum value is around 3.87. If Volume is 1, the max is around 6.42 maybe?

I'll scour the docs and see if I can find the actual maximums, and then modify this to properly normalize.

franz's picture
good 2 know

thanks for this valuable info. the original audio input patch does output normalized float, indeed.

gtoledo3's picture
I think it is happening for

I think it is happening for me, at least some of the time, with signals that have a DC offset that makes the low end go "whammo"(note the technical term), or with things that have been extremely peak limited (or possible just pushed into digital distortion).

This is kind of outside of the realms of where you guys are going with it (and go there by all means), but I would be curious if you took that signal and did a highpass filtering, somewhere around 22~40hz, if it would reign this in.

cwright's picture
all-pass

It seems to happen for all frequencies, not just the low ones (though low freq's are easy to get high values).

I'm still not exactly sure what's going on to cause this -- The built-in patch uses an AudioUnit, while we just use raw CoreAudio -- there shouldn't be any difference, but obviously there is. I've not been able to find a way to properly scale these values either.

Worst-case, we can use int samples instead of float ones, but then we have endianness and packed/unpacked stuff to deal with... meh. Audio should be a solved problem by now!