On OS X
Sample values are typically within [-1.0...1.0)
, where the maximum and minimum correspond to 0 dBFS. However, you should be prepared to handle larger sample values.
Many people who work with floating point rendering/mixing graphs are accustomed to working without consideration of exceeding 0 dBFS. They may verify the signal does not exceed 0 dBFS only when they output to hardware or an audio file.
If you just have a synth which sums 5 sines, each at -6 dBFS, there should be no clipping of the signal under normal situations, even if you exceed [-1...1) because you are using floating point numbers to represent your signal.
there are a few exceptions to this:
- you are using an unusual AU host which does not use a floating point mixer (i can't think of one which is actively developed)
- or not bringing the output down before it hits the DAC
- or not bringing the output down before it is saved to a file (although audio files can save in floating point too)
- a component somewhere in the signal path does not process in floating point or support floating point inputs. this is common for dedicated hardware processors, but many 3rd party plugins process in floating point these days.
I will typically prove/disprove this by sending it a signal which would obviously clip. Of course, a signal processor/generator which opted to process using ints could (and should) leave a good amount of headroom to avoid clipping (because it's not likely that the processor processes audio using anything less than 32 bit).
On iOS
Because floating point processing is much slower on iOS devices, the canonic AudioUnitSampleType
is specified as Q7.24 fixed point.
An explanation of this format can be found here. See also the posts surrounding this topic.
Because this is not floating point, you will have to much more careful about your gain stages to avoid internal clipping.
Also note that it is possible to configure a 32 bit float
graph on iOS. In that case, you should avoid exceeding [-1.0...1.0)
at the output of your processor because it is likely that your output will be converted to a non-floating point representation sooner than later (compared to OS X), unless of course you have direct control of the gain staging at suitable points downstream in the processing chain and you adjust the amplitude at those points appropriately.