Hi,
There is no other documentation on audio effects framework than the
java doc for APIs
and the comments in EffectApi.h for effect engine implementers.
You are almost correct when saying that "effects are applied either
per-track before mixing, or on the output mix".
The exact statement would be that "INSERT effects are applied either
per AUDIO SESSION before mixing, or on the output mix".
With the exception of audio session 0 which by convention refers to
the output mix, an audio session refers to either an AudioTrack or a
group of
AudioTracks. An insert effect created on a particular session applies
to all AudioTracks in that session.
Now the AUXILIARY effects (currently only the Reverb when attached to
output mix - session 0) are handled differently. An Auxiliary effect
will process several inputs from AudioTracks (or MediaPlayers) and
accumulate the result to the output mix. When the auxiliary effect is
created, it will not process anything by default. An AudioTrack must
be explicitly sent to the the effect with the attachAuxEffect
method(). Then the amount of signal sent to the effect is modified by
the
setAuxEffectSendLevel() method. This means that the AudioTrack has a
WET path (going though the effect) and a DRY path going directly to
the output mix. So, yes, although instantiated on the session 0
(output mix), auxiliary effects do not
apply equally to all sources.
The statement "same effect engine being used multiple times" means
that INSIDE A GIVEN AUDIO SESSION, the same effect engine is reused if
2 applications create 2 instances of a the same effect type.
There is no built-in mechanism in the framework to ensure that effects
applied in different sessions do not conflict with each other.
However, current effect library implementation has an optimized
processing when multiple effects are applied within the same session.
It is up to to the implementor of platform specific effect libraries
that would replace the default ones to add this type of optimizations.
A similar reply applies to your last question. The effect engines are
notified by the effect frameworks of audio device changes. It is up to
the implementor to alter the process according to the type of device
or devices connected.
For instance, current virtualizer implementation behaves differently
whether headphones are connected or not.
Hope this helps.
Eric.
> per-track before mixing, or on the output mix